Created
May 27, 2024 23:20
-
-
Save shelvacu/282abea848d103818a20b379c1846fed to your computer and use it in GitHub Desktop.
Remove dependency on colorlog in home-assistant core
This file contains 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
diff --git a/homeassistant/scripts/check_config.py b/homeassistant/scripts/check_config.py | |
index d38e24a2..b3c9f59c 100644 | |
--- a/homeassistant/scripts/check_config.py | |
+++ b/homeassistant/scripts/check_config.py | |
@@ -28,8 +28,6 @@ import homeassistant.util.yaml.loader as yaml_loader | |
# mypy: allow-untyped-calls, allow-untyped-defs | |
-REQUIREMENTS = ("colorlog==6.8.2",) | |
- | |
_LOGGER = logging.getLogger(__name__) | |
MOCKS: dict[str, tuple[str, Callable]] = { | |
"load": ("homeassistant.util.yaml.loader.load_yaml", yaml_loader.load_yaml), | |
@@ -44,19 +42,8 @@ ERROR_STR = "General Errors" | |
WARNING_STR = "General Warnings" | |
-def color(the_color, *args, reset=None): | |
- """Color helper.""" | |
- # pylint: disable-next=import-outside-toplevel | |
- from colorlog.escape_codes import escape_codes, parse_colors | |
- | |
- try: | |
- if not args: | |
- assert reset is None, "You cannot reset if nothing being printed" | |
- return parse_colors(the_color) | |
- return parse_colors(the_color) + " ".join(args) + escape_codes[reset or "reset"] | |
- except KeyError as k: | |
- raise ValueError(f"Invalid color {k!s} in {the_color}") from k | |
- | |
+def color(_the_color, *args, reset=None): | |
+ return " ".join(args) | |
def run(script_args: list) -> int: | |
"""Handle check config commandline script.""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment