Package epydoc :: Module util :: Class TerminalController
[hide private]
[frames] | no frames]

ClassType TerminalController

source code

A class that can be used to portably generate formatted output to a terminal. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116 for documentation. (This is a somewhat stripped-down version.)

Instance Methods [hide private]
 
__init__(self, term_stream=sys.stdout) source code
call graph 
 
_tigetstr(self, cap_name) source code
call graph 
 
render(self, template)
Replace each $-substitutions in the given template string with the corresponding terminal control string (if it's defined) or '' (if it's not).
source code
 
_render_sub(self, match) source code
Class Variables [hide private]
  BOL = ''
Move the cursor to the beginning of the line
  UP = ''
Move the cursor up one line
  DOWN = ''
Move the cursor down one line
  LEFT = ''
Move the cursor left one char
  RIGHT = ''
Move the cursor right one char
  CLEAR_EOL = ''
Clear to the end of the line.
  CLEAR_LINE = ''
Clear the current line; cursor to BOL.
  BOLD = ''
Turn on bold mode
  NORMAL = ''
Turn off all modes
  COLS = 75
Width of the terminal (default to 75)
  UNDERLINE = ''
Underline the text
  REVERSE = ''
Reverse the foreground & background
  WHITE = ''
  YELLOW = ''
  MAGENTA = ''
  RED = ''
  CYAN = ''
  GREEN = ''
  BLUE = ''
  BLACK = ''
  _STRING_CAPABILITIES = ['BOL=cr', 'UP=cuu1', 'DOWN=cud1', 'LEF...
  _COLORS = ['BLACK', 'BLUE', 'GREEN', 'CYAN', 'RED', 'MAGENTA',...
  _ANSICOLORS = ['BLACK', 'RED', 'GREEN', 'YELLOW', 'BLUE', 'MAG...
  FORCE_SIMPLE_TERM = False
If this is set to true, then new TerminalControllers will assume that the terminal is not capable of doing manipulation of any kind.
Class Variable Details [hide private]

_STRING_CAPABILITIES

Value:
['BOL=cr',
 'UP=cuu1',
 'DOWN=cud1',
 'LEFT=cub1',
 'RIGHT=cuf1',
 'REVERSE=rev',
 'CLEAR_EOL=el',
 'BOLD=bold',
...

_COLORS

Value:
['BLACK',
 'BLUE',
 'GREEN',
 'CYAN',
 'RED',
 'MAGENTA',
 'YELLOW',
 'WHITE']

_ANSICOLORS

Value:
['BLACK',
 'RED',
 'GREEN',
 'YELLOW',
 'BLUE',
 'MAGENTA',
 'CYAN',
 'WHITE']