From: José Fonseca Date: Wed, 2 Sep 2009 07:15:31 +0000 (+0100) Subject: Use the plain formatter on Windows. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=4b68bc8d262c80e571ca5185118b941117967628;p=apitrace Use the plain formatter on Windows. --- diff --git a/xml2txt.py b/xml2txt.py index 2edd183..5d51367 100755 --- a/xml2txt.py +++ b/xml2txt.py @@ -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()