Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.support.pygments.console Namespace Reference

Functions

def reset_color
def colorize
def ansiformat

Variables

string esc = "\x1b["
dictionary codes = {}
list dark_colors
list light_colors
int x = 30

Function Documentation

Format ``text`` with a color and/or some attributes::

    color       normal color
    *color*     bold color
    _color_     underlined color
    +color+     blinking color

Definition at line 52 of file console.py.

00052 
00053 def ansiformat(attr, text):
00054     """
00055     Format ``text`` with a color and/or some attributes::
00056 
00057         color       normal color
00058         *color*     bold color
00059         _color_     underlined color
00060         +color+     blinking color
00061     """
00062     result = []
00063     if attr[:1] == attr[-1:] == '+':
00064         result.append(codes['blink'])
00065         attr = attr[1:-1]
00066     if attr[:1] == attr[-1:] == '*':
00067         result.append(codes['bold'])
00068         attr = attr[1:-1]
00069     if attr[:1] == attr[-1:] == '_':
00070         result.append(codes['underline'])
00071         attr = attr[1:-1]
00072     result.append(codes[attr])
00073     result.append(text)
00074     result.append(codes['reset'])
00075     return ''.join(result)

Here is the caller graph for this function:

def MoinMoin.support.pygments.console.colorize (   color_key,
  text 
)

Definition at line 48 of file console.py.

00048 
00049 def colorize(color_key, text):
00050     return codes[color_key] + text + codes["reset"]
00051 

Here is the caller graph for this function:

Definition at line 44 of file console.py.

00044 
00045 def reset_color():
00046     return codes["reset"]
00047 


Variable Documentation

Definition at line 14 of file console.py.

Initial value:
00001 ["black", "darkred", "darkgreen", "brown", "darkblue",
00002                 "purple", "teal", "lightgray"]

Definition at line 25 of file console.py.

Definition at line 12 of file console.py.

Initial value:
00001 ["darkgray", "red", "green", "yellow", "blue",
00002                 "fuchsia", "turquoise", "white"]

Definition at line 27 of file console.py.

Definition at line 30 of file console.py.