python: Use Ansi escape codes regardless of output is a tty or not.

This commit is contained in:
José Fonseca
2009-03-25 10:22:05 +00:00
parent b52b78a226
commit 5743483778
@@ -27,6 +27,9 @@
##########################################################################
import sys
class Formatter:
'''Plain formatter'''
@@ -93,7 +96,7 @@ class AnsiFormatter(Formatter):
def DefaultFormatter(stream):
if stream.isatty():
if sys.platform in ('linux2', 'cygwin'):
return AnsiFormatter(stream)
else:
return Formatter(stream)