From 688c3a34f6f76cc09584c5974ced92220b6defe7 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 15 Oct 2022 18:21:53 -0700 Subject: [PATCH] define CustomColorType --- jc/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 02682786..59dac8f1 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -39,8 +39,9 @@ try: from pygments.lexers.data import JsonLexer, YamlLexer from pygments.formatters import Terminal256Formatter PYGMENTS_INSTALLED = True + CustomColorType = Dict[Union[Name.Tag, Number, String, Keyword], str] except Exception: - pass + CustomColorType = Dict # type: ignore JC_CLEAN_EXIT: int = 0 JC_ERROR_EXIT: int = 100 @@ -86,7 +87,7 @@ class JcCli(): self.parser_name: Optional[str] = None self.indent: int = 0 self.pad: int = 0 - self.custom_colors: Dict = {} + self.custom_colors: CustomColorType = {} self.show_hidden: bool = False self.ascii_only: bool = False self.json_separators: Optional[tuple[str, str]] = (',', ':')