]> git.cworth.org Git - apitrace/commitdiff
Use the plain formatter on Windows.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 2 Sep 2009 07:15:31 +0000 (08:15 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 2 Sep 2009 07:15:31 +0000 (08:15 +0100)
xml2txt.py

index 2edd1833ff75eb1d8a5bfc7fb2890e3ac52f973c..5d51367b901936550e307d551f2c5eba279eb2f5 100755 (executable)
@@ -238,6 +238,13 @@ class AnsiFormatter(Formatter):
         return self._escape(self._green, text)
 
 
+def DefaultFormatter():
+    if sys.platform in ('linux2', 'cygwin'):
+        return AnsiFormatter()
+    else:
+        return Formatter()
+
+
 class TraceParser(XmlParser):
 
     def __init__(self, stream, formatter):
@@ -390,7 +397,7 @@ def main():
     (options, args) = parser.parse_args(sys.argv[1:])
 
     if options.color == 'always' or options.color == 'auto' and sys.stdout.isatty():
-        formatter = AnsiFormatter()
+        formatter = DefaultFormatter()
     else:
         formatter = Formatter()