From 71066614c9d2f465073bdedf791d161ae9d8af59 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sun, 9 Aug 2015 22:41:06 -0700 Subject: [PATCH] Remove color_enabled() function and replace with LOG_COLOR usage Change-Id: I664f76aab7873e4393ca1b9d0428092ee14460c0 --- anvil/colorizer.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/anvil/colorizer.py b/anvil/colorizer.py index e1580d69..7e550122 100644 --- a/anvil/colorizer.py +++ b/anvil/colorizer.py @@ -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