class documentation

class RawTokenFormatter(Formatter):

View In Hierarchy

Format tokens as a raw representation for storing token streams.

The format is tokentype<TAB>repr(tokenstring)\n. The output can later be converted to a token stream with the RawTokenLexer, described in the :doc:`lexer list <lexers>`.

Only two options are accepted:

compress
If set to 'gz' or 'bz2', compress the output with the given compression algorithm after encoding (default: '').
error_color

If set to a color name, highlight error tokens using that color. If set but with no value, defaults to 'red'.

New in version 0.11.
Method __init__ Undocumented
Method format Format tokensource, an iterable of (tokentype, tokenstring) tuples and write it into outfile.
Class Variable aliases Undocumented
Class Variable filenames Undocumented
Class Variable name Undocumented
Class Variable unicodeoutput Undocumented
Instance Variable compress Undocumented
Instance Variable encoding Undocumented
Instance Variable error​_color Undocumented

Inherited from Formatter:

Method get​_style​_defs Return the style definitions for the current style as a string.
Instance Variable full Undocumented
Instance Variable options Undocumented
Instance Variable style Undocumented
Instance Variable title Undocumented
def __init__(self, **options):

Undocumented

def format(self, tokensource, outfile):
Format tokensource, an iterable of (tokentype, tokenstring) tuples and write it into outfile.
aliases: list[str] =

Undocumented

filenames: list[str] =
name: str =

Undocumented

unicodeoutput: bool =
compress =

Undocumented

encoding: str =

Undocumented

error_color: str =

Undocumented