Example #1
0
 def format(self, tokensource, outfile):
     # hack: if the output is a terminal and has an encoding set,
     # use that to avoid unicode encode problems
     if not self.encoding and hasattr(outfile, "encoding") and \
        hasattr(outfile, "isatty") and outfile.isatty():
         self.encoding = outfile.encoding
     return Formatter.format(self, tokensource, outfile)
Example #2
0
 def format(self, tokensource, outfile):
     # hack: if the output is a terminal and has an encoding set,
     # use that to avoid unicode encode problems
     if not self.encoding and hasattr(outfile, "encoding") and \
        hasattr(outfile, "isatty") and outfile.isatty():
         self.encoding = outfile.encoding
     return Formatter.format(self, tokensource, outfile)
Example #3
0
 def format(self, tokensource, outfile):
     # hack: if the output is a terminal and has an encoding set,
     # use that to avoid unicode encode problems
     if (not self.encoding and hasattr(outfile, "encoding")
             and hasattr(outfile, "isatty") and outfile.isatty()
             and sys.version_info < (3, )):
         self.encoding = outfile.encoding
         pass
     self.outfile = outfile
     return Formatter.format(self, tokensource, outfile)
Example #4
0
 def format(self, tokensource, outfile):
     return Formatter.format(self, tokensource, outfile)
Example #5
0
 def format(self, tokensource, outfile):
     return Formatter.format(self, tokensource, outfile)
Example #6
0
 def format(self, tokensource, outfile):
     self.encoding = outfile.encoding
     return Formatter.format(self, tokensource, outfile)
Example #7
0
 def format(self, tokensource, outfile):
     self.encoding = outfile.encoding
     return Formatter.format(self, tokensource, outfile)