lsst.pex.config  13.0-4-gbcd7061+4
 All Classes Namespaces Files Functions Variables Properties Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.pex.config.history.Color Class Reference
Inheritance diagram for lsst.pex.config.history.Color:

Public Member Functions

def __init__
 
def __str__
 

Static Public Member Functions

def colorize
 

Public Attributes

 rawText
 

Static Public Attributes

tuple categories
 
dictionary colors
 

Detailed Description

Control whether strings should be coloured

The usual usage is `Color(string, category)` which returns a string that
may be printed; categories are given by the keys of Color.categories

Color.colorize() may be used to set or retrieve whether the user wants
colour; it always returns False when sys.stdout is not attached to a
terminal.

Definition at line 33 of file history.py.

Constructor & Destructor Documentation

def lsst.pex.config.history.Color.__init__ (   self,
  text,
  category 
)
Return a string that should display as coloured on a conformant terminal

Definition at line 65 of file history.py.

Member Function Documentation

def lsst.pex.config.history.Color.__str__ (   self)

Definition at line 117 of file history.py.

def lsst.pex.config.history.Color.colorize (   val = None)
static
Should I colour strings?  With an argument, set the value

The value is usually a bool, but it may be a dict which is used
to modify Color.categories

N.b. only strings written to a terminal are colourized

Definition at line 89 of file history.py.

Member Data Documentation

tuple lsst.pex.config.history.Color.categories
static
Initial value:
1 = dict(
2  NAME="blue",
3  VALUE="yellow",
4  FILE="green",
5  TEXT="red",
6  FUNCTION_NAME="blue",
7  )

Definition at line 44 of file history.py.

dictionary lsst.pex.config.history.Color.colors
static
Initial value:
1 = {
2  "black": 0,
3  "red": 1,
4  "green": 2,
5  "yellow": 3,
6  "blue": 4,
7  "magenta": 5,
8  "cyan": 6,
9  "white": 7,
10  }

Definition at line 52 of file history.py.

lsst.pex.config.history.Color.rawText

Definition at line 72 of file history.py.


The documentation for this class was generated from the following file: