PyFoam.Basics.TerminalFormatter module

Formats the output on a terminal

class PyFoam.Basics.TerminalFormatter.TerminalFormatter[source]

Bases: object

Class that contains the formating codes for the terminal

addFormat(name, specification)[source]

Add a new format to the object :param name: Name under which the format is added to the formatter :param specification: The specification string for the format

back_black = '\x1b[40m'
back_blue = '\x1b[44m'
back_cyan = '\x1b[43m'
back_green = '\x1b[42m'
back_magenta = '\x1b[45m'
back_red = '\x1b[41m'
back_white = '\x1b[47m'
back_yellow = '\x1b[46m'
black = '\x1b[30m'
blue = '\x1b[34m'
bold = '\x1b[1m'
buildSequence(specification)[source]

Build an escape sequence from a specification string :param specification: the specification string that is a number of komma-separated words. The words specify the color and the formatting

cyan = '\x1b[33m'
getConfigFormat(name, shortName=None)[source]

Gets a format sequence from the global configuration and adds it to the formatter object :param name: Name under which this is found in the ‘Formats’-section of the configuration :param shortName: Short name under which this is stored in the foratter. If none is given the regular name is used

green = '\x1b[32m'
magenta = '\x1b[35m'
red = '\x1b[31m'
reset = '\x1b(B\x1b[m'
standout = '\x1b[7m'
under = '\x1b[4m'
white = '\x1b[37m'
yellow = '\x1b[36m'
PyFoam.Basics.TerminalFormatter.getTerminalCode(code)[source]