Merge "Remove color_enabled() function and replace with LOG_COLOR usage"

This commit is contained in:
Jenkins 2015-08-11 16:18:29 +00:00 committed by Gerrit Code Review
commit 533349b11d
1 changed files with 2 additions and 6 deletions

View File

@ -30,12 +30,8 @@ if not sys.stdout.isatty():
LOG_COLOR = False
def color_enabled():
return LOG_COLOR
def quote(data, quote_color='green', **kargs):
if not color_enabled():
if not LOG_COLOR:
return "'%s'" % (data)
else:
text = str(data)
@ -53,7 +49,7 @@ def color(data, color_to_be, bold=False, underline=False, blink=False):
text_attrs.append('underline')
if blink:
text_attrs.append('blink')
if color_enabled() and color_to_be in COLORS:
if LOG_COLOR and color_to_be in COLORS:
return termcolor.colored(text, color_to_be, attrs=text_attrs)
else:
return text