# ``twisted`.`conch`.`ui`.`ansi`.`AnsiParser``

class documentation

`class AnsiParser: (source)`

View In Hierarchy

Parser class for ANSI codes.

Method | `__init__` | Undocumented
Method | `formatText` | Undocumented
Method | `parseColor` | Handle a single ANSI color sequence
Method | `parseCursor` | Undocumented
Method | `parseErase` | Undocumented
Method | `parseString` | Turn a string input into a list of `ColorText` elements.
Method | `pickColor` | Undocumented
Method | `stripEscapes` | Remove all ANSI color escapes from the given string.
Method | `writeString` | 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 | `blink` | Undocumented
Instance Variable | `bold` | Undocumented
Instance Variable | `currentBG` | Undocumented
Instance Variable | `currentFG` | Undocumented
Instance Variable | `defaultBG` | Undocumented
Instance Variable | `defaultFG` | 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')

SETS = (source)

Undocumented

Value

    (CURSOR_SET, ERASE_SET, MODE_SET, ASSIGN_SET, COLOR_SET)

blink: `int` = (source)

Undocumented

bold: `int` = (source)

Undocumented

currentBG = (source)

Undocumented

currentFG = (source)

Undocumented

defaultBG = (source)

Undocumented

defaultFG = (source)

Undocumented

display: `int` = (source)

Undocumented

flash: `int` = (source)

Undocumented

prepend = (source)

Undocumented

reverse: `int` = (source)

Undocumented

underline: `int` = (source)

Undocumented