tamcolors.tam package¶
Submodules¶
tamcolors.tam.tam_loop module¶
-
class
tamcolors.tam.tam_loop.
TAMFrame
(fps, char, foreground_color, background_color, min_width=0, max_width=1000, min_height=0, max_height=1000)¶ Bases:
object
-
done
(tam_loop, loop_data, other_handlers, other_data)¶ info: called when TAMLoop is terminating and can only be called once :param tam_loop: TAMLoop :param loop_data: dict :param other_handlers: dict :param other_data: dict :return:
-
draw
(tam_surface, loop_data, other_surfaces, other_data)¶ info: will draw frame onto terminal :param tam_surface: TAMSurface :param loop_data: object :param other_surfaces: dict :param other_data: dict :return:
-
frame_done
(tam_loop, loop_data, other_handlers, other_data)¶ info: called when clean up the frame and can only be called once :param tam_loop: TAMLoop :param loop_data: dict :param other_handlers: dict :param other_data: dict :return:
-
get_defaults
()¶ info: gets defaults :return: (str, int, int)
-
get_fps
()¶ info: returns the frame fps :return: int
-
get_height_min_and_max
()¶ info: returns min and max height :return: (int, int)
-
get_width_min_and_max
()¶ info: returns min and max width :return: (int, int)
-
make_surface_ready
(tam_surface, screen_width, screen_height)¶ info: will make surface ready for frame :param tam_surface: TAMSurface :param screen_width: int: 0 - inf :param screen_height: int: 0 - inf :return:
-
update
(tam_loop, keys, loop_data, other_handlers, other_keys, other_data)¶ info: will update terminal :param tam_loop: TAMLoop :param keys: list, tuple :param loop_data: objects :param other_handlers: dict :param other_keys: dict :param other_data: dict :return:
-
-
class
tamcolors.tam.tam_loop.
TAMLoop
(tam_frame, io=None, only_any_os=False, color_change_key=('ESCAPE', 'SPECIAL'), loop_data=None, stability_check=False, tam_color_defaults=True, highest_mode_lock=False, preferred_mode=None, name=None, identifier_id=None, start_data=None, receivers=None, other_handlers=None, thread_count=20, enable_loop_log=False, loop_log_key=('F1', 'SPECIAL'), loop_log_level=10, enable_loop_fps=True, loop_fps_key=('F2', 'SPECIAL'))¶ Bases:
tamcolors.tam.tam_loop_io_handler.TAMLoopIOHandler
-
add_frame_stack
(frame)¶ info: will add a TAMFrame to stack :param frame: TAMFrame :return:
-
add_receiver
(receiver)¶
-
done
()¶ info: will stop tam loop :return: None
-
get_all_receiver_names
()¶
-
get_receiver_settings
()¶ info: gets the receiver settings :return: dict
-
pop_frame_stack
()¶ info: will remove TAMFrame from stack :return: TAMFrame or None
-
remove_receiver
(receiver_name)¶
-
classmethod
run_application
(*args, **kwargs)¶ info: will run tam loop as an application note: when tam loop is done running the program will quit if tam loop has an error and the frame does not catch it the error will be printed onto the screen and the program will quit after user input :param args: :param kwargs: :return:
-
thread_task
(func, *args, **kwargs)¶
-
-
exception
tamcolors.tam.tam_loop.
TAMLoopError
¶ Bases:
Exception
tamcolors.tam.tam_loop_io_handler module¶
-
class
tamcolors.tam.tam_loop_io_handler.
TAMLoopIOHandler
(io, name=None, identifier_id=None, color_change_key=('ESCAPE', 'SPECIAL'), start_data=None, loop_data=None, tam_color_defaults=True, highest_mode_lock=False, preferred_mode=None, reset_io=True)¶ Bases:
object
-
done
()¶ info: will stop tam loop :return: None
-
enable_key_state_mode
(enable=True)¶ info: Will enable or disable key state mode :param enable: bool :return: None
-
freeze_handler
()¶ info: will freeze event loop :return:
-
get_color_16
(spot)¶ info: Will get color from color palette 16 :param spot: int :return: RGBA
-
get_color_16_pal_256
(spot)¶ info: Will get color from color palette 2 :param spot: int :return: RGBA
-
get_color_2
(spot)¶ info: Will get color from color palette 2 :param spot: int :return: RGBA
-
get_color_256
(spot)¶ info: Will get color from color palette 256 :param spot: int :return: RGBA
-
get_dimensions
()¶ info: Will get the dimensions of the terminal :return: tuple
-
get_full_name
()¶ info: get full name :return: tuple
-
get_identifier_id
()¶ info: get identifier id :return: bytes or None
-
get_io
()¶ infl: will get the IO :return: IO
-
get_keyboard_name
(default_to_us_english=True)¶ info: Will get the keyboard language name :param default_to_us_english: bool :return: str
-
get_loop_data
()¶ info: get loop data :return: object
-
get_name
()¶ info: get name :return: str or None
-
get_start_data
()¶ info: get start data :return: object
-
is_key_state_mode_enabled
()¶ info: Will get the status of key_state :return: bool
-
is_running
()¶ info: None has not ran, True is running, False has ran :return: bool or None
-
pump_keys
()¶ info: will get keys from the key queue :return: list
-
reset_colors_to_console_defaults
()¶ info: will reset colors to console defaults :return: None
-
run
()¶ info: will call tam loop :return: None
-
run_with_profiler
()¶ info: will run with a profiler and print out data when done :return: None
-
set_color_16
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_color_16_pal_256
(spot, color)¶ info: sets a color value :param spot: int :param color: int :return: None
-
set_color_2
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_color_256
(spot, color)¶ info: sets a color value :param spot: int :param color: RGBA :return: None
-
set_loop_data
(loop_data)¶ info: set loop data :param loop_data: object :return: None
-
set_start_data
(start_data)¶ info: set start data :param start_data: object :return: None
-
set_tam_color_defaults
()¶ info: will set console colors to tam defaults :return: None
-
unfreeze_handler
()¶ info: will unfreeze event loop :return:
-
tamcolors.tam.tam_loop_io_tcp_handler module¶
-
class
tamcolors.tam.tam_loop_io_tcp_handler.
TAMLoopIOTCPHandler
(io, name=None, identifier_id=None, color_change_key=('ESCAPE', 'SPECIAL'), start_data=None, loop_data=None, tam_color_defaults=True, highest_mode_lock=False, preferred_mode=None, reset_io=True)¶ Bases:
tamcolors.tam.tam_loop_io_handler.TAMLoopIOHandler
-
done
()¶ info: will stop tam loop :return: None
-
is_running
()¶ info: None has not ran, True is running, False has ran :return: bool or None
-
tamcolors.tam.tam_loop_receiver module¶
-
class
tamcolors.tam.tam_loop_receiver.
TAMLoopReceiver
(name)¶ Bases:
abc.ABC
-
done
()¶ info: Will stop the receiver :return: None
-
get_handler
()¶ info: Will get an io if available :return: TAMLoopIOHandler or None
-
get_name
()¶ info: Will get the receiver name :return: str
-
get_receiver_settings
()¶ info: will get the receiver io settings :return: dict or None
-
get_running
()¶ info: Checks if receiver is running :return: bool
-
set_receiver_settings
(settings)¶ info: will set the receiver io settings :param settings: dict :return: None
-
tamcolors.tam.tam_loop_tcp_receiver module¶
-
class
tamcolors.tam.tam_loop_tcp_receiver.
TAMLoopTCPReceiver
(host='127.0.0.1', port=4444, ipv6=False, listen_count=10, connection_password='', address_white_list=None, address_black_list=None, encryption=None, object_packer=None, our_information=None)¶ Bases:
tamcolors.tam.tam_loop_receiver.TAMLoopReceiver
-
done
()¶ info: Will stop the receiver :return: None
-
get_handler
()¶ info: Will get an io if available :return: TAMLoopIOHandler or None
-