PyFoam.Basics.TerminalFormatter module
Formats the output on a terminal
- class PyFoam.Basics.TerminalFormatter.TerminalFormatter[source]
Bases:
objectClass that contains the formating codes for the terminal
- __dict__ = mappingproxy({'__module__': 'PyFoam.Basics.TerminalFormatter', '__doc__': 'Class that contains the formating codes for the terminal', 'reset': '\x1b(B\x1b[m', 'bold': '\x1b[1m', 'under': '\x1b[4m', 'standout': '\x1b[7m', 'black': '\x1b[30m', 'red': '\x1b[31m', 'green': '\x1b[32m', 'cyan': '\x1b[33m', 'blue': '\x1b[34m', 'magenta': '\x1b[35m', 'yellow': '\x1b[36m', 'white': '\x1b[37m', 'back_black': '\x1b[40m', 'back_red': '\x1b[41m', 'back_green': '\x1b[42m', 'back_cyan': '\x1b[43m', 'back_blue': '\x1b[44m', 'back_magenta': '\x1b[45m', 'back_yellow': '\x1b[46m', 'back_white': '\x1b[47m', 'buildSequence': <function TerminalFormatter.buildSequence>, 'addFormat': <function TerminalFormatter.addFormat>, 'getConfigFormat': <function TerminalFormatter.getConfigFormat>, '__dict__': <attribute '__dict__' of 'TerminalFormatter' objects>, '__weakref__': <attribute '__weakref__' of 'TerminalFormatter' objects>, '__annotations__': {}})
- __module__ = 'PyFoam.Basics.TerminalFormatter'
- __weakref__
list of weak references to the object (if defined)
- 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'