tamcolors.tam_io package

Submodules

tamcolors.tam_io.any_tam module

class tamcolors.tam_io.any_tam.AnyIO

Bases: tamcolors.tam_io.io_tam.IO

clear()
done()
draw(tam_buffer)

info: draws tam_buffer to terminal :param tam_buffer: :return:

get_dimensions()
classmethod get_io()

info: will see if environment supported by AnyIO :return: AnyIO object or None

get_key()

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

get_key_dict()
get_mode()

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

get_modes()
inputc(value, color)
printc(value, color)
set_mode(mode)

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

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

IO defines standards for all terminal IO

class tamcolors.tam_io.io_tam.IO

Bases: object

clear()
done()
draw(tam_buffer)
get_dimensions()
classmethod get_io()
get_key()
static get_key_dict()
get_mode()
get_modes()
inputc(output, color)
printc(value, color)
set_mode(mode)
start()

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)

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_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

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)

info: sets a single spot on the buffer :param x: int :param y: int :param char: str: len of 1 :param foreground_color: int: -1 - inf: use current foreground_color :param background_color: int: -1 - inf: use current background_color :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

Bases: tamcolors.tam_io.io_tam.IO

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_dimensions()
classmethod get_io()

info: will see if environment supported by LinIO :return: LinIO object or None

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

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(output, color)
set_mode(mode)

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

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

Bases: tamcolors.tam_io.io_tam.IO

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_dimensions()
classmethod get_io()

info: will see if environment supported by WinIO :return: WinIO object or None

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

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(output, color)
set_mode(mode)

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

start()

info: will setup terminal to be used :return:

win_io = <tamcolors.tam_io.win_tam.WinIO object>
exception tamcolors.tam_io.win_tam.WinIOError

Bases: Exception

Module contents