tamcolors.tam_io package

Submodules

tamcolors.tam_io.any_tam module

class tamcolors.tam_io.any_tam.AnyIO(*args, **kwargs)

Bases: tamcolors.tam_io.io_tam.SingletonIO

classmethod able_to_execute()

info: will see if environment supported by AnyIO :return: bool

clear()
done()
get_color(spot)

info: will get the color value :param spot: int :return: tuple: (int, int, int)

get_dimensions()
get_key()

info: AnyIO can’t get key input :return: False

get_key_dict()
inputc(value, color)

info: will get user input with color :param value: str :param color: tuple: (int, int) :return: str

printc(value, color, flush, stderr)

info: will print out user output with color :param value: str :param color: tuple: (int, int) :param flush: boolean :param stderr: boolean :return: None

start()
exception tamcolors.tam_io.any_tam.AnyIOError

Bases: Exception

tamcolors.tam_io.any_tam.get_io(io_list=None, any_os=False)

info: gets the right io for environment :param io_list: list, tuple, None: ios that can be used :param any_os: bool :return: IO or None

tamcolors.tam_io.io_tam module

class tamcolors.tam_io.io_tam.IO(mode_2=True, mode_16=True)

Bases: object

classmethod able_to_execute()
clear()
done()
draw(tam_buffer)
get_color(spot)
get_dimensions()
get_key()
static get_key_dict()
get_mode()

info: will return the current color mode :return: int

get_modes()

info: will return a tuple of all color modes :return: (int, int, …)

inputc(output, color)
printc(value, color, flush, stderr)
reset_colors_to_console_defaults()

info: will reset colors to consoloe defaults :return: None

set_color(spot, color)

info: sets a color value :param spot: int: 0 - 15 :param color: tuple: (int, int, int) :return: None

set_mode(mode)

info: will set the color mode :param mode: int: key to color mode :return:

set_tam_color_defaults()

info: will set console colors to tam defaults :return: None

start()
class tamcolors.tam_io.io_tam.SingletonIO(*args, **kwargs)

Bases: tamcolors.tam_io.io_tam.IO

Only lets one IO instance exist

tamcolors.tam_io.tam_buffer module

class tamcolors.tam_io.tam_buffer.TAMBuffer(width, height, char, foreground_color, background_color)

Bases: object

clear()

info: clears TAMBuffer :return:

copy()

info: copy’s TAMBuffer :return: TAMBuffer

draw_onto(tam_buffer, start_x=0, start_y=0, buffer_start_x=0, buffer_start_y=0, buffer_size_x=- 1, buffer_size_y=- 1, override_alpha=True)

info: will draw tam_buffer or part of a TAMBuffer onto another TAMBuffer :param tam_buffer: TAMBuffer :param start_x: int :param start_y: int :param buffer_start_x: int :param buffer_start_y: int :param buffer_size_x: int: 0 - inf :param buffer_size_y: int: 0 - inf :param override_alpha: bool :return:

get_cross_rect(tam_buffer, start_x=0, start_y=0, buffer_start_x=0, buffer_start_y=0, buffer_size_x=- 1, buffer_size_y=- 1)

info: will draw tam_buffer or part of a TAMBuffer onto another TAMBuffer :param tam_buffer: TAMBuffer :param start_x: int :param start_y: int :param buffer_start_x: int :param buffer_start_y: int :param buffer_size_x: int: 0 - inf :param buffer_size_y: int: 0 - inf :return:

get_defaults()

info: gets defaults :return: (str, int, int)

get_dimensions()

info: gets buffer dimensions :return: (int, int)

get_from_raw_spot(spot)

info: gets spot info :param spot: x: int: 0 - (len(tam_buffer) - 1) :return: (int, int, int) or None

get_raw_buffers()

info: gets raw buffers :return: (list, list, list)

get_raw_spot(x, y)

info: return -1 if not a spot :param x: int :param y: int :return: int

get_spot(x, y)

info: gets spot info :param x: int :param y: int :return: (int, int, int) or None

replace_alpha_chars(alpha_replacement=None)
Parameters

alpha_replacement – None or str

Returns

set_defaults_and_clear(char, foreground_color, background_color)

info: clears buffer and resets defaults :param char: str: len of 1 :param foreground_color: int: 0 - inf :param background_color: int: 0 - inf :return:

set_dimensions_and_clear(width, height)

info: clears and resizes TAMBuffer :param width: int: 0 - inf :param height: int: 0 - inf :return:

set_spot(x, y, char, foreground_color, background_color, override_alpha=True)

info: sets a single spot on the buffer :param x: int :param y: int :param char: str: len of 1 :param foreground_color: int :param background_color: int :param override_alpha: bool :return:

tamcolors.tam_io.tam_colors module

terminal colors supported on all platforms

tamcolors.tam_io.tam_keys module

tamcolors.tam_io.uni_tam module

class tamcolors.tam_io.uni_tam.UniIO(*args, **kwargs)

Bases: tamcolors.tam_io.io_tam.SingletonIO

classmethod able_to_execute()

info: will see if environment supported by UniIO :return: bool

clear()

info: will clear the screen. Note that it will also reset the terminal :return:

done()

info: will reset terminal :return:

draw(tam_buffer)

info: will draw tam buffer to terminal :param tam_buffer: TAMBuffer :return:

get_color(spot)

info: will get the color value :param spot: int :return: tuple: (int, int, int)

get_dimensions()

info: will get teh terminal dimensions :return: (int, int)

get_key()

info: will get single key input or return False :return: str or False

static get_key_dict()

info: makes a dict mapping key codes to key :return: dict

inputc(output, color)

info: will get user input with color :param output: str :param color: tuple: (int, int) :return: str

printc(output, color, flush, stderr)

info: will print out user output with color :param output: str :param color: tuple: (int, int) :param flush: boolean :param stderr: boolean :return: None

set_color(spot, color)

info: sets a color value :param spot: int: 0 - 15 :param color: tuple: (int, int, int) :return: None

start()

info: will setup terminal to be used :return:

exception tamcolors.tam_io.uni_tam.UniIOError

Bases: Exception

tamcolors.tam_io.win_tam module

class tamcolors.tam_io.win_tam.WinIO(*args, **kwargs)

Bases: tamcolors.tam_io.io_tam.SingletonIO

classmethod able_to_execute()

info: will see if environment supported by WinIO :return: bool

clear()

info: will clear the screen :return:

done()

info: will reset terminal :return:

draw(tam_buffer)

info: will draw tam buffer to terminal :param tam_buffer: TAMBuffer :return:

get_color(spot)

info: will get the color value :param spot: int :return: tuple: (int, int, int)

get_dimensions()

info: will get teh terminal dimensions :return: (int, int)

get_key()

info: will get single key input or return False :return: str or False

static get_key_dict()

info: makes a dict mapping key codes to key :return: dict

inputc(output, color)

info: will get user input with color :param output: str :param color: tuple: (int, int) :return: str

printc(output, color, flush, stderr)

info: will print out user output with color :param output: str :param color: tuple: (int, int) :param flush: boolean :param stderr: boolean :return: None

set_color(spot, color)

info: sets a color value :param spot: int: 0 - 15 :param color: tuple: (int, int, int) :return: None

start()

info: will setup terminal to be used :return:

exception tamcolors.tam_io.win_tam.WinIOError

Bases: Exception

Module contents