From 15c9002d9eff0f52d873fb3ab35dfafd03a8e919 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 8 Jan 2021 11:56:56 -0800 Subject: [PATCH] simplify logic by taking out 'not' in JC_COLORS parsing --- jc/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index fedf6727..ae0e4abc 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -191,10 +191,10 @@ def set_env_colors(env_colors=None): # Try the color set in the JC_COLORS env variable first. If it is set to default, then fall back to default colors return { - Name.Tag: f'bold {PYGMENT_COLOR[color_list[0]]}' if not color_list[0] == 'default' else f"bold {PYGMENT_COLOR['blue']}", # key names - Keyword: PYGMENT_COLOR[color_list[1]] if not color_list[1] == 'default' else PYGMENT_COLOR['brightblack'], # true, false, null - Number: PYGMENT_COLOR[color_list[2]] if not color_list[2] == 'default' else PYGMENT_COLOR['magenta'], # numbers - String: PYGMENT_COLOR[color_list[3]] if not color_list[3] == 'default' else PYGMENT_COLOR['green'] # strings + Name.Tag: f'bold {PYGMENT_COLOR[color_list[0]]}' if color_list[0] != 'default' else f"bold {PYGMENT_COLOR['blue']}", # key names + Keyword: PYGMENT_COLOR[color_list[1]] if color_list[1] != 'default' else PYGMENT_COLOR['brightblack'], # true, false, null + Number: PYGMENT_COLOR[color_list[2]] if color_list[2] != 'default' else PYGMENT_COLOR['magenta'], # numbers + String: PYGMENT_COLOR[color_list[3]] if color_list[3] != 'default' else PYGMENT_COLOR['green'] # strings }