class documentation

class PythonPrinter(object):

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method ​_flush​_adjusted​_lines Undocumented
Method ​_in​_multi​_line return true if the given line is part of a multi-line block, via backslash or triple-quote.
Method ​_indent​_line indent the given line according to the current indent level.
Method ​_is​_unindentor return true if the given line is an 'unindentor', relative to the last 'indent' event received.
Method ​_reset​_multi​_line​_flags reset the flags which would indicate we are in a backslashed or triple-quoted section.
Method ​_update​_lineno Undocumented
Method close close this printer, flushing any remaining lines.
Method start​_source Undocumented
Method write​_blanks Undocumented
Method write​_indented​_block print a line or lines of python which already contain indentation.
Method writeline print a line of python, indenting it according to the current indent level.
Method writelines print a series of lines of python.
Instance Variable backslashed Undocumented
Instance Variable in​_indent​_lines Undocumented
Instance Variable indent Undocumented
Instance Variable indent​_detail Undocumented
Instance Variable indentstring Undocumented
Instance Variable line​_buffer Undocumented
Instance Variable lineno Undocumented
Instance Variable source​_map Undocumented
Instance Variable stream Undocumented
Instance Variable triplequoted Undocumented
def __init__(self, stream):

Undocumented

def _flush_adjusted_lines(self):

Undocumented

def _in_multi_line(self, line):
return true if the given line is part of a multi-line block, via backslash or triple-quote.
def _indent_line(self, line, stripspace=''):

indent the given line according to the current indent level.

stripspace is a string of space that will be truncated from the start of the line before indenting.

def _is_unindentor(self, line):
return true if the given line is an 'unindentor', relative to the last 'indent' event received.
def _reset_multi_line_flags(self):
reset the flags which would indicate we are in a backslashed or triple-quoted section.
def _update_lineno(self, num):

Undocumented

def close(self):
close this printer, flushing any remaining lines.
def start_source(self, lineno):

Undocumented

def write_blanks(self, num):

Undocumented

def write_indented_block(self, block, starting_lineno=None):

print a line or lines of python which already contain indentation.

The indentation of the total block of lines will be adjusted to that of the current indent level.

def writeline(self, line):

print a line of python, indenting it according to the current indent level.

this also adjusts the indentation counter according to the content of the line.

def writelines(self, *lines):
print a series of lines of python.
backslashed: bool =

Undocumented

in_indent_lines: bool =

Undocumented

indent: int =

Undocumented

indent_detail: list =

Undocumented

indentstring: str =

Undocumented

line_buffer: list =

Undocumented

lineno: int =

Undocumented

source_map: dict =

Undocumented

stream =

Undocumented

triplequoted =

Undocumented