| Trees | Index | Help |
|
|---|
| Module ansi |
|
This holds a series of classes and functions for helping to manipulate ANSI color codes.
In general, Lyntin keeps the data from the mud intact without doing any transformations on it letting the ui do the transformations it needs to do to display the mud data. The exception to this is when the user has shut off mudansi using the #config command. Then we'll whack any incoming ANSI color stuff before moving it around.| Function Summary | |
|---|---|
| string |
Takes in a color tuple like what figure_color creates and converts it into an ANSI color sequence. |
| ((int, int, int), string) |
Takes a textlist of text and color tokens and figures out the latest current color. |
| string |
Takes in text and filters out the ANSI color codes. |
| string |
Helper function for debugging--it'll fix a color token so it's readable in ascii. |
| string |
Looks at the style (which is a comma separated list of styles) and figures out the markup string and returns it. |
| boolean |
Returns whether or not this is a color token. |
| list of strings |
Takes in a string and separates it into a list of strings and ansi color strings. |
| Variable Summary | |
|---|---|
SRE_Pattern |
ANSI_COLOR_REGEXP
|
list |
DEFAULT_COLOR
|
int |
PLACE_BG
|
int |
PLACE_BLINK
|
int |
PLACE_BOLD
|
int |
PLACE_FG
|
int |
PLACE_REVERSE
|
int |
PLACE_UNDERLINE
|
int |
STYLE_BLINK
|
int |
STYLE_BOLD
|
int |
STYLE_NORMAL
|
int |
STYLE_REVERSE
|
int |
STYLE_UNDERLINE
|
dict |
STYLEMAP
|
| Function Details |
|---|
convert_tuple_to_ansi(token)Takes in a color tuple like what figure_color creates and converts it into an ANSI color sequence.
|
figure_color(textlist, currentcolor, leftover='')Takes a textlist of text and color tokens and figures out the latest current color.
|
filter_ansi(text)Takes in text and filters out the ANSI color codes.
|
fix_color(color)Helper function for debugging--it'll fix a color token so it's readable in ascii. It just replaces instances of chr(27) with "ESC".
|
get_color(style)Looks at the style (which is a comma separated list of styles) and figures out the markup string and returns it.
|
is_color_token(token)Returns whether or not this is a color token. It figures this out by checking to see if the token matches this regexp: chr(27) + '\[[0-9;]*[m]'
|
split_ansi_from_text(text)Takes in a string and separates it into a list of strings and ansi color strings.
|
| Variable Details |
|---|
ANSI_COLOR_REGEXP
|
DEFAULT_COLOR
|
PLACE_BG
|
PLACE_BLINK
|
PLACE_BOLD
|
PLACE_FG
|
PLACE_REVERSE
|
PLACE_UNDERLINE
|
STYLE_BLINK
|
STYLE_BOLD
|
STYLE_NORMAL
|
STYLE_REVERSE
|
STYLE_UNDERLINE
|
STYLEMAP
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 1.1 on Mon Apr 28 21:11:24 2003 | http://epydoc.sf.net |