Reuse termcolor's environment variable to disable colors

This commit is contained in:
Laurent Bachelier 2013-08-03 01:09:45 +02:00
commit e78714b560
2 changed files with 5 additions and 2 deletions

View file

@ -63,7 +63,9 @@ class ConsoleApplication(BaseApplication):
CAPS = None
# shell escape strings
if sys.platform == 'win32' or not os.isatty(sys.stdout.fileno()):
if sys.platform == 'win32' \
or not os.isatty(sys.stdout.fileno()) \
or os.getenv('ANSI_COLORS_DISABLED') is not None:
#workaround to disable bold
BOLD = ''
NC = '' # no color