class documentation

class RawTokenFormatter(Formatter): (source)

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'``. .. versionadded:: 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): (source)

Undocumented

def format(self, tokensource, outfile): (source)

Format ``tokensource``, an iterable of ``(tokentype, tokenstring)`` tuples and write it into ``outfile``.

compress = (source)

Undocumented

error_color: str = (source)

Undocumented