colorama package

Submodules

colorama.ansi module

This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code

class colorama.ansi.AnsiBack[source]

Bases : colorama.ansi.AnsiCodes

BLACK = 40
BLUE = 44
CYAN = 46
GREEN = 42
LIGHTBLACK_EX = 100
LIGHTBLUE_EX = 104
LIGHTCYAN_EX = 106
LIGHTGREEN_EX = 102
LIGHTMAGENTA_EX = 105
LIGHTRED_EX = 101
LIGHTWHITE_EX = 107
LIGHTYELLOW_EX = 103
MAGENTA = 45
RED = 41
RESET = 49
WHITE = 47
YELLOW = 43
class colorama.ansi.AnsiCodes[source]

Bases : object

class colorama.ansi.AnsiCursor[source]

Bases : object

BACK(n=1)[source]
DOWN(n=1)[source]
FORWARD(n=1)[source]
POS(x=1, y=1)[source]
UP(n=1)[source]
class colorama.ansi.AnsiFore[source]

Bases : colorama.ansi.AnsiCodes

BLACK = 30
BLUE = 34
CYAN = 36
GREEN = 32
LIGHTBLACK_EX = 90
LIGHTBLUE_EX = 94
LIGHTCYAN_EX = 96
LIGHTGREEN_EX = 92
LIGHTMAGENTA_EX = 95
LIGHTRED_EX = 91
LIGHTWHITE_EX = 97
LIGHTYELLOW_EX = 93
MAGENTA = 35
RED = 31
RESET = 39
WHITE = 37
YELLOW = 33
class colorama.ansi.AnsiStyle[source]

Bases : colorama.ansi.AnsiCodes

BRIGHT = 1
DIM = 2
NORMAL = 22
RESET_ALL = 0
colorama.ansi.clear_line(mode=2)[source]
colorama.ansi.clear_screen(mode=2)[source]
colorama.ansi.code_to_chars(code)[source]
colorama.ansi.set_title(title)[source]

colorama.ansitowin32 module

class colorama.ansitowin32.AnsiToWin32(wrapped, convert=None, strip=None, autoreset=False)[source]

Bases : object

Implements a “write()” method which, on Windows, will strip ANSI character sequences from the text, and if outputting to a tty, will convert them into win32 function calls.

ANSI_CSI_RE = re.compile('\x01?\x1b\\[((?:\\d|;)*)([a-zA-Z])\x02?')
ANSI_OSC_RE = re.compile('\x01?\x1b\\]([^\x07]*)(\x07)\x02?')
call_win32(command, params)[source]
convert_ansi(paramstring, command)[source]
convert_osc(text)[source]
extract_params(command, paramstring)[source]
get_win32_calls()[source]
reset_all()[source]
should_wrap()[source]

True if this class is actually needed. If false, then the output stream will not be affected, nor will win32 calls be issued, so wrapping stdout is not actually required. This will generally be False on non-Windows platforms, unless optional functionality like autoreset has been requested using kwargs to init()

write(text)[source]
write_and_convert(text)[source]

Write the given text to our wrapped stream, stripping any ANSI sequences from the text, and optionally converting them into win32 calls.

write_plain_text(text, start, end)[source]
class colorama.ansitowin32.StreamWrapper(wrapped, converter)[source]

Bases : object

Wraps a stream (such as stdout), acting as a transparent proxy for all attribute access apart from method “write()”, which is delegated to our Converter instance.

closed
isatty()[source]
write(text)[source]

colorama.initialise module

with colorama.initialise.colorama_text(*args, **kwargs)[source]
colorama.initialise.deinit()[source]
colorama.initialise.init(autoreset=False, convert=None, strip=None, wrap=True)[source]
colorama.initialise.reinit()[source]
colorama.initialise.reset_all()[source]
colorama.initialise.wrap_stream(stream, convert, strip, autoreset, wrap)[source]

colorama.win32 module

colorama.win32.SetConsoleTextAttribute(*_)[source]
colorama.win32.winapi_test(*_)[source]

colorama.winterm module

class colorama.winterm.WinColor[source]

Bases : object

BLACK = 0
BLUE = 1
CYAN = 3
GREEN = 2
GREY = 7
MAGENTA = 5
RED = 4
YELLOW = 6
class colorama.winterm.WinStyle[source]

Bases : object

BRIGHT = 8
BRIGHT_BACKGROUND = 128
NORMAL = 0
class colorama.winterm.WinTerm[source]

Bases : object

back(back=None, light=False, on_stderr=False)[source]
cursor_adjust(x, y, on_stderr=False)[source]
erase_line(mode=0, on_stderr=False)[source]
erase_screen(mode=0, on_stderr=False)[source]
fore(fore=None, light=False, on_stderr=False)[source]
get_attrs()[source]
get_position(handle)[source]
reset_all(on_stderr=None)[source]
set_attrs(value)[source]
set_console(attrs=None, on_stderr=False)[source]
set_cursor_position(position=None, on_stderr=False)[source]
set_title(title)[source]
style(style=None, on_stderr=False)[source]

Module contents