diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2018-03-18 10:03:48 +1100 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2018-03-18 10:03:48 +1100 |
| commit | 1cff79bcc6f64c8b52c255c9dd161cd5564bf748 (patch) | |
| tree | 83cdf5ba3ce1a50575c17e28521530e2deea4ac8 /pywal/__main__.py | |
| parent | 20ae5f8d7a3367bf0483cc8aae018419fbdb1ef0 (diff) | |
theme: Move theme handling to own file.
Diffstat (limited to 'pywal/__main__.py')
| -rw-r--r-- | pywal/__main__.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py index 43f4465..8086e39 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -14,12 +14,13 @@ import os import shutil import sys -from .settings import __version__, CACHE_DIR, MODULE_DIR, CONF_DIR +from .settings import __version__, CACHE_DIR, CONF_DIR from . import colors from . import export from . import image from . import reload from . import sequences +from . import theme from . import util from . import wallpaper @@ -105,11 +106,7 @@ def process_args(args): sys.exit(0) if args.f == "list_themes": - themes = os.listdir(os.path.join(CONF_DIR, "colorschemes")) - themes += os.listdir(os.path.join(MODULE_DIR, "colorschemes")) - themes = [theme.replace(".json", "") for theme in themes] - - print("Themes:", ", ".join(themes)) + print("Themes:", ", ".join(theme.index())) sys.exit(0) if args.q: @@ -133,7 +130,7 @@ def process_args(args): colors_plain = colors.get(image_file, light=args.l) if args.f: - colors_plain = colors.file(args.f) + colors_plain = theme.file(args.f) if args.a: util.Color.alpha_num = args.a @@ -165,6 +162,9 @@ def process_args(args): def main(): """Main script function.""" + util.create_dir(os.path.join(CONF_DIR, "colorschemes")) + util.create_dir(os.path.join(CONF_DIR, "templates")) + args = get_args(sys.argv[1:]) process_args(args) |
