class documentation

class AnsiParser: (source)

View In Hierarchy

Parser class for ANSI codes.
Method __init__ Undocumented
Method format​Text Undocumented
Method parse​Color Handle a single ANSI color sequence
Method parse​Cursor Undocumented
Method parse​Erase Undocumented
Method parse​String Turn a string input into a list of ColorText elements.
Method pick​Color Undocumented
Method strip​Escapes Remove all ANSI color escapes from the given string.
Method write​String Undocumented
Constant ASSIGN​_SET Undocumented
Constant COLOR​_SET Undocumented
Constant CURSOR​_SET Undocumented
Constant ERASE​_SET Undocumented
Constant MODE​_SET Undocumented
Constant SETS Undocumented
Instance Variable bold Undocumented
Instance Variable current​BG Undocumented
Instance Variable current​FG Undocumented
Instance Variable default​BG Undocumented
Instance Variable default​FG Undocumented
Instance Variable display Undocumented
Instance Variable flash Undocumented
Instance Variable prepend Undocumented
Instance Variable reverse Undocumented
Instance Variable underline Undocumented
def __init__(self, defaultFG, defaultBG): (source)

Undocumented

def formatText(self, text): (source)

Undocumented

def parseColor(self, str): (source)
Handle a single ANSI color sequence
def parseCursor(self, cursor): (source)

Undocumented

def parseErase(self, erase): (source)

Undocumented

def parseString(self, str): (source)
Turn a string input into a list of ColorText elements.
def pickColor(self, value, mode, BOLD=ColorText.BOLD_COLORS): (source)

Undocumented

def stripEscapes(self, string): (source)
Remove all ANSI color escapes from the given string.
def writeString(self, colorstr): (source)

Undocumented

ASSIGN_SET: tuple[str, ...] = (source)

Undocumented

Value
('p')
COLOR_SET: tuple[str, ...] = (source)

Undocumented

Value
('m')
CURSOR_SET: tuple[str, ...] = (source)

Undocumented

Value
('H', 'f', 'A', 'B', 'C', 'D', 'R', 's', 'u', 'd', 'G')
ERASE_SET: tuple[str, ...] = (source)

Undocumented

Value
('J', 'K', 'P')
MODE_SET: tuple[str, ...] = (source)

Undocumented

Value
('h', 'l')
bold = (source)

Undocumented

currentBG = (source)

Undocumented

currentFG = (source)

Undocumented

defaultBG = (source)

Undocumented

defaultFG = (source)

Undocumented

display: int = (source)

Undocumented

flash = (source)

Undocumented

prepend: str = (source)

Undocumented

reverse = (source)

Undocumented

underline = (source)

Undocumented