Package twisted :: Package conch :: Package ui :: Module ansi :: Class AnsiParser

[show private | hide private]
[frames | no frames]

## Class AnsiParser

Parser class for ANSI codes.

Method Summary
| `__init__(self, defaultFG, defaultBG)`
| `formatText(self, text)`
| ``parseColor`(self, str)` Handle a single ANSI color sequence
| `parseCursor(self, cursor)`
| `parseErase(self, erase)`
| ``parseString`(self, str)` Turn a string input into a list of ColorText elements.
| `pickColor(self, value, mode, BOLD)`
| ``stripEscapes`(self, string)` Remove all ANSI color escapes from the given string.
| `writeString(self, colorstr)`

Class Variable Summary
`tuple` | `ASSIGN_SET`
`tuple` | `COLOR_SET`
`tuple` | `CURSOR_SET`
`tuple` | `ERASE_SET`
`tuple` | `MODE_SET`
`tuple` | `SETS`

Method Details

### parseColor(self, str)

Handle a single ANSI color sequence

### parseString(self, str)

Turn a string input into a list of ColorText elements.

### stripEscapes(self, string)

Remove all ANSI color escapes from the given string.

Class Variable Details

### ASSIGN_SET

  Type:
    `tuple`
  Value:

        ('p',)

### COLOR_SET

  Type:
    `tuple`
  Value:

        ('m',)

### CURSOR_SET

  Type:
    `tuple`
  Value:

        ('H', 'f', 'A', 'B', 'C', 'D', 'R', 's', 'u', 'd', 'G')

### ERASE_SET

  Type:
    `tuple`
  Value:

        ('J', 'K', 'P')

### MODE_SET

  Type:
    `tuple`
  Value:

        ('h', 'l')

### SETS

  Type:
    `tuple`
  Value:

        (('H', 'f', 'A', 'B', 'C', 'D', 'R', 's', 'u', 'd', 'G'),
         ('J', 'K', 'P'),
         ('h', 'l'),
         ('p',),
         ('m',))

Generated by Epydoc 1.1 on Thu May 8 13:16:23 2003 | http://epydoc.sf.net