diff options
author | ThanosApollo <[email protected]> | 2022-10-01 08:37:56 +0300 |
---|---|---|
committer | ThanosApollo <[email protected]> | 2022-10-01 08:37:56 +0300 |
commit | aeb7f1457eb5fa0591f2f1020d83a616d9b1fcb6 (patch) | |
tree | b5b7fd4ee1bd336d82348ff0a799f1e0c8847fdb /.local/share/Anki2/addons21/anki_reworked/utils/themes.py | |
parent | a4a7c05aaa05c267ce304697daddde6637fbd8a9 (diff) |
Remove anki add ons
Diffstat (limited to '.local/share/Anki2/addons21/anki_reworked/utils/themes.py')
-rw-r--r-- | .local/share/Anki2/addons21/anki_reworked/utils/themes.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/.local/share/Anki2/addons21/anki_reworked/utils/themes.py b/.local/share/Anki2/addons21/anki_reworked/utils/themes.py deleted file mode 100644 index 36af2d9..0000000 --- a/.local/share/Anki2/addons21/anki_reworked/utils/themes.py +++ /dev/null @@ -1,34 +0,0 @@ -import os -import json -from aqt import mw -from .logger import logger - -this_script_dir = os.path.join(os.path.dirname(__file__), "..") -themes_dir = os.path.join(this_script_dir, 'themes') - -def get_themes_dict() -> dict: - # Replace pathing for theme files (ReColor compatible) - themes = {} - for file in os.listdir(themes_dir): - if "json" in file: - file = file.replace(".json", "") - if themes.get(file, "") == "": - themes[file] = os.path.join(themes_dir, file+'.json') - return themes - -def get_theme(theme: str) -> dict: - themes_parsed = json.loads(open(themes[theme], encoding='utf-8').read()) - theme_colors = themes_parsed.get("colors") - # Add extra color_keys on theme files if not exist (ReColor compatible) - if not theme_colors.get("PRIMARY_COLOR", False): - theme_colors["PRIMARY_COLOR"] = ["Primary Color", "#0093d0", "#0093d0", "--primary-color"] - if not theme_colors.get("FOCUS_SHADOW", False): - theme_colors["FOCUS_SHADOW"] = ["Focus Shadow", "#ff93d0", "#0093d0", "--focus-shadow-color"] - themes_parsed["colors"] = theme_colors - return themes_parsed - -def write_theme(file, theme_content): - with open(file, "w") as f: - json.dump(theme_content, f, indent=2, sort_keys=True) - -themes = get_themes_dict() |