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

Class TerminalFormatter

source code

object --+
         |
        TerminalFormatter

Class that contains the formating codes for the terminal

Instance Methods [hide private]
 
buildSequence(self, specification)
Build an escape sequence from a specification string
source code
 
addFormat(self, name, specification)
Add a new format to the object
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__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  reset = getTerminalCode("sgr0")
  bold = getTerminalCode("bold")
  under = getTerminalCode("smul")
  standout = getTerminalCode("smso")
  black = getTerminalCode("setaf 0")
  red = getTerminalCode("setaf 1")
  green = getTerminalCode("setaf 2")
  cyan = getTerminalCode("setaf 3")
  blue = getTerminalCode("setaf 4")
  magenta = getTerminalCode("setaf 5")
  yellow = getTerminalCode("setaf 6")
  white = getTerminalCode("setaf 7")
  back_black = getTerminalCode("setab 0")
  back_red = getTerminalCode("setab 1")
  back_green = getTerminalCode("setab 2")
  back_cyan = getTerminalCode("setab 3")
  back_blue = getTerminalCode("setab 4")
  back_magenta = getTerminalCode("setab 5")
  back_yellow = getTerminalCode("setab 6")
  back_white = getTerminalCode("setab 7")
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

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

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