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

Class 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)
  _tigetstr(self, cap_name)

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 Width of the terminal (default to 75)
WHITE  
YELLOW  
MAGENTA  
RED  
CYAN  
GREEN  
BLUE  
BLACK  
_STRING_CAPABILITIES  
_COLORS  
_ANSICOLORS  

Method Details [hide private]

__init__(self, term_stream=sys.stdout)
(Constructor)

source code 

_tigetstr(self, cap_name)

source code 

Class Variable Details [hide private]

BOL

Move the cursor to the beginning of the line
Value:
''                                                                     
      

UP

Move the cursor up one line
Value:
''                                                                     
      

DOWN

Move the cursor down one line
Value:
''                                                                     
      

LEFT

Move the cursor left one char
Value:
''                                                                     
      

RIGHT

Move the cursor right one char
Value:
''                                                                     
      

CLEAR_EOL

Clear to the end of the line.
Value:
''                                                                     
      

CLEAR_LINE

Clear the current line; cursor to BOL.
Value:
''                                                                     
      

BOLD

Turn on bold mode
Value:
''                                                                     
      

NORMAL

Turn off all modes
Value:
''                                                                     
      

COLS

Width of the terminal (default to 75)
Value:
75                                                                    
      

WHITE

Value:
''                                                                     
      

YELLOW

Value:
''                                                                     
      

MAGENTA

Value:
''                                                                     
      

RED

Value:
''                                                                     
      

CYAN

Value:
''                                                                     
      

GREEN

Value:
''                                                                     
      

BLUE

Value:
''                                                                     
      

BLACK

Value:
''                                                                     
      

_STRING_CAPABILITIES

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

_COLORS

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

_ANSICOLORS

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