Package PyFoam :: Package Basics :: Module TerminalFormatter :: Class TerminalFormatter
[hide private]
[frames] | no frames]

Class TerminalFormatter

source code


Class that contains the formating codes for the terminal

Instance Methods [hide private]
 
addFormat(self, name, specification)
Add a new format to the object
source code
 
buildSequence(self, specification)
Build an escape sequence from a specification string
source code
 
getConfigFormat(self, name, shortName=None)
Gets a format sequence from the global configuration and adds it to the formatter object
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  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'
  cyan = '\x1b[33m'
  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'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

addFormat(self, name, specification)

source code 

Add a new format to the object

Parameters:
  • name - Name under which the format is added to the formatter
  • specification - The specification string for the format

buildSequence(self, specification)

source code 

Build an escape sequence from a specification string

Parameters:
  • specification - the specification string that is a number of komma-separated words. The words specify the color and the formatting

getConfigFormat(self, name, shortName=None)

source code 

Gets a format sequence from the global configuration and adds it to the formatter object

Parameters:
  • name - Name under which this is found in the 'Formats'-section of the configuration
  • shortName - Short name under which this is stored in the foratter. If none is given the regular name is used