python: Use Ansi escape codes regardless of output is a tty or not.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 25 Mar 2009 10:22:05 +0000 (10:22 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 25 Mar 2009 21:03:36 +0000 (21:03 +0000)
src/gallium/state_trackers/python/retrace/format.py

index 0bf6baf0b940f88ddfc805b67fd9774fcb94b10d..d56d72f606f22c18bef0b77bf66e3801544f0fe9 100755 (executable)
@@ -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)