This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def repr_dict_obj( | |
| candidate: object, | |
| classname: str | None = None, | |
| attr_alt_reprs: ( | |
| None | dict[str, str | Callable[[object], str] | Literal["__exclude__"]] | |
| ) = None, | |
| ) -> str: | |
| """ | |
| Return a dataclass inspired repr string for given object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def setup_logging(level: str | int, colored: bool) -> logging.Logger: | |
| """Set up logging for the application.""" | |
| class ColorFormatter(logging.Formatter): | |
| """Logging formatter for colored output.""" | |
| RESET_STYLE = "\033[0m" # ANSI code to reset all style information | |
| LEVEL_COLOR = { | |
| # map logging levels to colorized ansi style codes | |
| # the string must follow this pattern "\033[<code>m" | |
| # lookup other supported color codes here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| # Copyright (c) 2020 Valentin Weber | |
| # | |
| # After some minor modifications (as marked below) this EventGhost | |
| # Python script provides a method to send requests to devices | |
| # registered with the Join API <https://joaoapps.com/join/api/> from | |
| # any EventGhost Python Script or Command. | |
| # | |
| # EventGhost usage: `eg.globals.JoinPushDevice(text="hello_world")` | |
| ## |