From 558b7e2796beb1b6284b4507806ddb119d59fb13 Mon Sep 17 00:00:00 2001 From: eylles Date: Tue, 28 Dec 2021 03:05:35 -0600 Subject: [PATCH] remove ref to 9 cols themes --- pywal/theme.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/pywal/theme.py b/pywal/theme.py index 89666ab..9dc4f13 100644 --- a/pywal/theme.py +++ b/pywal/theme.py @@ -16,10 +16,6 @@ def list_out(): for theme in list_themes()] ligh_themes = [theme.name.replace(".json", "") for theme in list_themes(dark=False)] - dark9_themes = [theme.name.replace(".json", "") - for theme in list_themes(nine=True)] - ligh9_themes = [theme.name.replace(".json", "") - for theme in list_themes(dark=False,nine=True)] user_themes = [theme.name.replace(".json", "") for theme in list_themes_user()] @@ -37,14 +33,8 @@ def list_out(): print("\033[1;32mDark Themes\033[0m:") print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t for t in sorted(dark_themes))) - print("\033[1;32mDark9 Themes\033[0m:") - print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t - for t in sorted(dark9_themes))) print("\033[1;32mLight Themes\033[0m:") - print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t - for t in sorted(ligh_themes))) - print("\033[1;32mLight9 Themes\033[0m:") print(" -", "\n - ".join(t + " (last used)" if t == last_used_theme else t for t in sorted(ligh_themes))) @@ -55,11 +45,10 @@ def list_out(): print(" - random_user (select a random user theme)") -def list_themes(dark=True, nine=False): +def list_themes(dark=True): """List all installed theme files.""" dark = "dark" if dark else "light" - nine = "9" if nine else "16" - themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark, nine)) + themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark)) return [t for t in themes if os.path.isfile(t.path)] @@ -102,7 +91,7 @@ def parse(theme_file): return data -def get_random_theme(dark=True, nine=False): +def get_random_theme(dark=True): """Get a random theme file.""" themes = [theme.path for theme in list_themes(dark)] random.shuffle(themes) @@ -116,17 +105,16 @@ def get_random_theme_user(): return themes[0] -def file(input_file, light=False, nine=False): +def file(input_file, light=False): """Import colorscheme from json file.""" util.create_dir(os.path.join(CONF_DIR, "colorschemes/light/")) util.create_dir(os.path.join(CONF_DIR, "colorschemes/dark/")) theme_name = ".".join((input_file, "json")) bri = "light" if light else "dark" - full16 = "9" if nine else "16" - user_theme_file = os.path.join(CONF_DIR, "colorschemes", full16, bri, theme_name) - theme_file = os.path.join(MODULE_DIR, "colorschemes", full16, bri, theme_name) + user_theme_file = os.path.join(CONF_DIR, "colorschemes", bri, theme_name) + theme_file = os.path.join(MODULE_DIR, "colorschemes", bri, theme_name) # Find the theme file. if input_file in ("random", "random_dark"): @@ -158,11 +146,9 @@ def file(input_file, light=False, nine=False): sys.exit(1) -def save(colors, theme_name, light=False, nine=False): +def save(colors, theme_name, light=False): """Save colors to a theme file.""" theme_file = theme_name + ".json" theme_path = os.path.join(CONF_DIR, "colorschemes", - "9" if nine else "16", - "light" if light else "dark", - theme_file) + "light" if light else "dark", theme_file) util.save_file_json(colors, theme_path)