lsst.pex.config  13.0-4-gbcd7061+12
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__ (self, text, category)
 
def __str__ (self)
 

Static Public Member Functions

def colorize (val=None)
 

Public Attributes

 rawText
 

Static Public Attributes

 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

◆ __init__()

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

◆ __str__()

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

Definition at line 117 of file history.py.

◆ colorize()

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

◆ categories

lsst.pex.config.history.Color.categories
static
Initial value:
= dict(
NAME="blue",
VALUE="yellow",
FILE="green",
TEXT="red",
FUNCTION_NAME="blue",
)

Definition at line 44 of file history.py.

◆ colors

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

Definition at line 52 of file history.py.

◆ rawText

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: