PythonPrinter

source

A Printer which prints to a file.

Constructors

new PythonPrinter(fs: __module, path: string, options: Partial<PrinterOptions>): PythonPrintersource

Properties

buffer: stringsource

inherited from Printer.buffer

currentIndent: stringsource

inherited from Printer.currentIndent

finalised: booleansource

inherited from Printer.finalised

readonlyfs: __modulesource

inherited from Printer.fs

readonlymoduleImports: Set<string>source

options: PrinterOptionssource

inherited from Printer.options

readonlypath: stringsource

inherited from Printer.path

storedBlockIndent: stringsource

inherited from Printer.storedBlockIndent

readonlysymbolImports: SetMapsource

readonlystaticimportPathMap: Map<string, string>source

Methods

Static methods

staticrewriteImportPath(pathOfSourceFile: string, pathOfImport: string): stringsource

Instance methods

addImport(moduleName: string): voidsource

addImports(importPath: string, symbols: string[]): voidsource

beforeFinalise(): voidsource

printBlock(block: string): voidsource

printDocComment(doc: string): voidsource

printScaryHeader(): voidsource

Inherited methods

continueLastBlockIndent(): voidsource

inherited from Printer.continueLastBlockIndent

decreaseIndent(): voidsource

inherited from Printer.decreaseIndent

finalise(): voidsource

inherited from Printer.finalise

getAndClearBuffer(): stringsource

inherited from Printer.getAndClearBuffer

getIndent(): stringsource

inherited from Printer.getIndent

getIndentLevel(): numbersource

inherited from Printer.getIndentLevel

increaseIndent(): voidsource

inherited from Printer.increaseIndent

print(s: string): voidsource

inherited from Printer.print

printLine(s: string = ""): voidsource

inherited from Printer.printLine

printLines(lines: readonly string[], options: PrintLinesOptions): voidsource

inherited from Printer.printLines

printNewline(): voidsource

inherited from Printer.printNewline

printWrapped(text: string, options: PrintLinesOptions): voidsource

inherited from Printer.printWrapped

printYamlText(text: string): voidsource

inherited from Printer.printYamlText

resetIndent(indent: string = ""): voidsource

inherited from Printer.resetIndent

withIndent(then: Function): voidsource

inherited from Printer.withIndent

withOutdent(then: Function): voidsource

inherited from Printer.withOutdent

wrapText(text: string, offsetLength: number = 0): string[]source

inherited from Printer.wrapText

staticaddImportPathMap(this: HasImportPathMap, from: string, to: string): voidsource

inherited from Printer.addImportPathMap

staticfinaliseAll(): voidsource

inherited from Printer.finaliseAll