From c1b86a232383748811c6faf17f364e63e10f7dd4 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 14 Nov 2012 11:36:51 +0900 Subject: Fix inconsistent indentation The repo coding style is to indent at 2 characters, but there are many places where this is not followed. Enable pylint warning "W0311: Bad indentation" and make sure all indentation is at multiples of 2 characters. Change-Id: I68f0f64470789ce2429ab11104d15d380a63e6a8 --- color.py | 62 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'color.py') diff --git a/color.py b/color.py index 33bc8779..d856313f 100644 --- a/color.py +++ b/color.py @@ -40,47 +40,47 @@ RESET = "\033[m" # pylint: disable=W1401 # backslash is not anomalous def is_color(s): - return s in COLORS + return s in COLORS def is_attr(s): - return s in ATTRS + return s in ATTRS def _Color(fg = None, bg = None, attr = None): - fg = COLORS[fg] - bg = COLORS[bg] - attr = ATTRS[attr] + fg = COLORS[fg] + bg = COLORS[bg] + attr = ATTRS[attr] - if attr >= 0 or fg >= 0 or bg >= 0: - need_sep = False - code = "\033[" #pylint: disable=W1401 + if attr >= 0 or fg >= 0 or bg >= 0: + need_sep = False + code = "\033[" #pylint: disable=W1401 - if attr >= 0: - code += chr(ord('0') + attr) - need_sep = True + if attr >= 0: + code += chr(ord('0') + attr) + need_sep = True - if fg >= 0: - if need_sep: - code += ';' - need_sep = True + if fg >= 0: + if need_sep: + code += ';' + need_sep = True - if fg < 8: - code += '3%c' % (ord('0') + fg) - else: - code += '38;5;%d' % fg + if fg < 8: + code += '3%c' % (ord('0') + fg) + else: + code += '38;5;%d' % fg - if bg >= 0: - if need_sep: - code += ';' - need_sep = True + if bg >= 0: + if need_sep: + code += ';' + need_sep = True - if bg < 8: - code += '4%c' % (ord('0') + bg) - else: - code += '48;5;%d' % bg - code += 'm' - else: - code = '' - return code + if bg < 8: + code += '4%c' % (ord('0') + bg) + else: + code += '48;5;%d' % bg + code += 'm' + else: + code = '' + return code class Coloring(object): -- cgit v1.2.3-54-g00ecf