From 332666ec4390a850e06c4108351b360f414a39c4 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Fri, 10 Apr 2020 15:25:37 +1000 Subject: [PATCH] Don't use any existing LS_COLORS colors. - The bundled color database probably looks better. --- eris/tools.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eris/tools.py b/eris/tools.py index d3e8ae1..29a5c40 100755 --- a/eris/tools.py +++ b/eris/tools.py @@ -77,12 +77,9 @@ STATUS_TO_TERMSTR[Status.pending] = "." def get_ls_color_codes(): - if "LS_COLORS" not in os.environ: - script = os.path.join(os.path.dirname(__file__), "LS_COLORS.sh") - with open(script) as file_: - codes = file_.readline().strip()[len("LS_COLORS='"):-len("';")] - os.environ["LS_COLORS"] = codes - return lscolors.get_color_codes(os.environ) + with importlib.resources.open_text(eris, "LS_COLORS.sh") as lscolors_file: + codes = lscolors_file.readline().strip()[len("LS_COLORS='"):-len("';")] + return lscolors._parse_ls_colors(codes) _LS_COLOR_CODES = get_ls_color_codes()