Display TTY  1
Customise your terminal's output
Loading...
Searching...
No Matches
display_tty.src.aliases Namespace Reference

Functions

 initialise (Union[Logging, str] class_name, bool debug=False, *, Optional[Dict[str, Any]] toml_content=None, Optional[bool] save_to_file=None, Optional[str] file_name=None, Optional[Any] file_descriptor=None, Optional[int] success=None, Optional[int] error=None, Optional[bool] log_warning_when_present=None, Optional[bool] log_errors_when_present=None)
 
 init (Union[Logging, str] class_name, bool debug=False, *, Optional[Dict[str, Any]] toml_content=None, Optional[bool] save_to_file=None, Optional[str] file_name=None, Optional[Any] file_descriptor=None, Optional[int] success=None, Optional[int] error=None, Optional[bool] log_warning_when_present=None, Optional[bool] log_errors_when_present=None)
 

Variables

 TMP = None
 
 OSTRING = OUT_STRING
 
 ODEFAULT = OUT_DEFAULT
 
 OFILE = OUT_FILE
 
 OTTY = OUT_TTY
 
 KOUTPUT_MODE = KEY_OUTPUT_MODE
 
 KPRETTIFY_OUTPUT = KEY_PRETTIFY_OUTPUT
 
 KANIMATION_DELAY = KEY_ANIMATION_DELAY
 
 KANIMATION_DELAY_BLOCKY = KEY_ANIMATION_DELAY_BLOCKY
 
 KPRETTIFY_OUTPUT_IN_BLOCKS = KEY_PRETTIFY_OUTPUT_IN_BLOCKS
 

Detailed Description

# +==== BEGIN display_tty =================+
# LOGO: 
# ..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# .@...........................#@
# @############################.@
# @...........................@.@
# @..#######################..@.@
# @.#########################.@.@
# @.##>_#####################.@.@
# @.#########################.@.@
# @.#########################.@.@
# @.#########################.@.@
# @.#########################.@.@
# @..#######################..@.@
# @...........................@.@
# @..+----+______________.....@.@
# @..+....+______________+....@.@
# @..+----+...................@.@
# @...........................@.#
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@#.
# /STOP
# PROJECT: display_tty
# FILE: aliases.py
# CREATION DATE: 06-11-2025
# LAST Modified: 13:6:20 06-11-2025
# DESCRIPTION: 
# A module that allows you to display text with a few boilers (i.e. put your text in a square for titles). It also allows to log to the terminal by wrapping around the logging library.
# /STOP
# COPYRIGHT: (c) Henry Letellier
# PURPOSE: File in charge of containing shorter names of the variables to ease the call.
# // AR
# +==== END display_tty =================+

Function Documentation

◆ init()

display_tty.src.aliases.init ( Union[Logging, str] class_name,
bool debug = False,
* ,
Optional[Dict[str, Any]] toml_content = None,
Optional[bool] save_to_file = None,
Optional[str] file_name = None,
Optional[Any] file_descriptor = None,
Optional[int] success = None,
Optional[int] error = None,
Optional[bool] log_warning_when_present = None,
Optional[bool] log_errors_when_present = None )
Short alias for `initialise` (and therefore `initialise_logger`).

Original documentation:
@brief Initialise and return a configured Disp instance for a given class or module.

This factory function creates and returns a configured `Disp` instance (the library's
display/logger wrapper) using defaults from `TOML_CONF`, `SAVE_TO_FILE` and `FILE_NAME`
unless overridden by the provided keyword arguments. The `class_name` may be a
`Logging`-compatible object (an object exposing logging-like methods) or a simple string
used as a label for the logger.

@param class_name Union[Logging, str]
    The logging owner (class instance or name) to attach to the returned `Disp` instance.
@param debug bool, optional
    If True the returned `Disp` instance will run in debug mode (enable debug-level output).
    Defaults to False.
@param toml_content Optional[Dict[str, Any]]
    Optional override for TOML configuration content (defaults to module-level TOML_CONF).
@param save_to_file Optional[bool]
    Optional override to enable saving output to a file (defaults to module-level SAVE_TO_FILE).
@param file_name Optional[str]
    Optional override for the file name used when saving to file (defaults to FILE_NAME).
@param file_descriptor Optional[Any]
    Optional open file-like object to use for output (will be passed to `Disp`).
@param success Optional[int]
    Optional custom success return code for the `Disp` instance.
@param error Optional[int]
    Optional custom error return code for the `Disp` instance.
@param log_warning_when_present Optional[bool]
    Optional flag to control whether warnings are logged when present.
@param log_errors_when_present Optional[bool]
    Optional flag to control whether errors are logged when present.

@return Disp
    A configured `Disp` instance ready to use.

@note
    - Optional arguments are only applied when provided (truthy) except `save_to_file` which is explicitly converted to bool when passed.
    - Use `file_descriptor` to reuse an open file handle instead of letting `Disp` open its own file.
    - This function updates only configuration passed to `Disp` and does not change library global constants.

Definition at line 171 of file aliases.py.

◆ initialise()

display_tty.src.aliases.initialise ( Union[Logging, str] class_name,
bool debug = False,
* ,
Optional[Dict[str, Any]] toml_content = None,
Optional[bool] save_to_file = None,
Optional[str] file_name = None,
Optional[Any] file_descriptor = None,
Optional[int] success = None,
Optional[int] error = None,
Optional[bool] log_warning_when_present = None,
Optional[bool] log_errors_when_present = None )
Alias for initialise_logger kept for API compatibility.

Original documentation:
@brief Initialise and return a configured Disp instance for a given class or module.

This factory function creates and returns a configured `Disp` instance (the library's
display/logger wrapper) using defaults from `TOML_CONF`, `SAVE_TO_FILE` and `FILE_NAME`
unless overridden by the provided keyword arguments. The `class_name` may be a
`Logging`-compatible object (an object exposing logging-like methods) or a simple string
used as a label for the logger.

@param class_name Union[Logging, str]
    The logging owner (class instance or name) to attach to the returned `Disp` instance.
@param debug bool, optional
    If True the returned `Disp` instance will run in debug mode (enable debug-level output).
    Defaults to False.
@param toml_content Optional[Dict[str, Any]]
    Optional override for TOML configuration content (defaults to module-level TOML_CONF).
@param save_to_file Optional[bool]
    Optional override to enable saving output to a file (defaults to module-level SAVE_TO_FILE).
@param file_name Optional[str]
    Optional override for the file name used when saving to file (defaults to FILE_NAME).
@param file_descriptor Optional[Any]
    Optional open file-like object to use for output (will be passed to `Disp`).
@param success Optional[int]
    Optional custom success return code for the `Disp` instance.
@param error Optional[int]
    Optional custom error return code for the `Disp` instance.
@param log_warning_when_present Optional[bool]
    Optional flag to control whether warnings are logged when present.
@param log_errors_when_present Optional[bool]
    Optional flag to control whether errors are logged when present.

@return Disp
    A configured `Disp` instance ready to use.

@note
    - Optional arguments are only applied when provided (truthy) except `save_to_file` which is explicitly converted to bool when passed.
    - Use `file_descriptor` to reuse an open file handle instead of letting `Disp` open its own file.
    - This function updates only configuration passed to `Disp` and does not change library global constants.

Definition at line 103 of file aliases.py.

Variable Documentation

◆ KANIMATION_DELAY

display_tty.src.aliases.KANIMATION_DELAY = KEY_ANIMATION_DELAY

Definition at line 88 of file aliases.py.

◆ KANIMATION_DELAY_BLOCKY

display_tty.src.aliases.KANIMATION_DELAY_BLOCKY = KEY_ANIMATION_DELAY_BLOCKY

Definition at line 94 of file aliases.py.

◆ KOUTPUT_MODE

display_tty.src.aliases.KOUTPUT_MODE = KEY_OUTPUT_MODE

Definition at line 76 of file aliases.py.

◆ KPRETTIFY_OUTPUT

display_tty.src.aliases.KPRETTIFY_OUTPUT = KEY_PRETTIFY_OUTPUT

Definition at line 82 of file aliases.py.

◆ KPRETTIFY_OUTPUT_IN_BLOCKS

display_tty.src.aliases.KPRETTIFY_OUTPUT_IN_BLOCKS = KEY_PRETTIFY_OUTPUT_IN_BLOCKS

Definition at line 100 of file aliases.py.

◆ ODEFAULT

display_tty.src.aliases.ODEFAULT = OUT_DEFAULT

Definition at line 57 of file aliases.py.

◆ OFILE

display_tty.src.aliases.OFILE = OUT_FILE

Definition at line 63 of file aliases.py.

◆ OSTRING

display_tty.src.aliases.OSTRING = OUT_STRING

Definition at line 51 of file aliases.py.

◆ OTTY

display_tty.src.aliases.OTTY = OUT_TTY

Definition at line 69 of file aliases.py.

◆ TMP

display_tty.src.aliases.TMP = None

Definition at line 43 of file aliases.py.