ats_utilities.reporter.theme.engine module

Module

engine.py

Copyright

Copyright (C) 2017 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com> ats_utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ats_utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Info

Defines class ConsoleTheme with attribute(s) and method(s). Implements a console theme for console styling.

class ats_utilities.reporter.theme.engine.ConsoleTheme(palette: dict[str, str] | None = None)[source]

Bases: IConsoleTheme

Defines class ConsoleTheme with attribute(s) and method(s). Implements a console theme for console styling.

It defines:

attributes:
_palette - Dictionary with color codes for different message types.
methods:
__init__ - Initializes ConsoleTheme constructor.
get_color - Returns color code from palette.
__str__ - Returns the string representation of ConsoleTheme.
_abc_impl = <_abc._abc_data object>
_default_palete_colors: dict[str, str] = {'error': '\x1b[31m', 'reset': '\x1b[0m', 'success': '\x1b[32m', 'verbose': '\x1b[34m', 'warning': '\x1b[33m'}
get_color(color_type: str) str[source]

Returns color code from palette.

Parameters:

color_type (<str>) – Type of the message (key in palette).

Returns:

Color code in string format.

Return type:

<str>

Exceptions:

None.