diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 10:51:52 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-22 10:51:52 +1000 |
| commit | 38afea4f2ef5a4a04ef44139aa1ed01f3655a797 (patch) | |
| tree | c8e3bc5f4eba14643ef5d6d8fd1c8f6e4eedbea2 /pywal | |
| parent | 3dd1fc9039822e4426d5dc8c3f807dd5f6f2d295 (diff) | |
General: move cache call
Diffstat (limited to 'pywal')
| -rw-r--r-- | pywal/image.py | 9 | ||||
| -rw-r--r-- | pywal/magic.py | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/pywal/image.py b/pywal/image.py index a7a314d..421943e 100644 --- a/pywal/image.py +++ b/pywal/image.py @@ -24,7 +24,7 @@ def get_random_image(img_dir, cache_dir): print("image: No new images found (nothing to do), exiting...") quit(1) - return img_dir / random.choice(images).name + return str(img_dir / random.choice(images).name) def get_image(img, cache_dir): @@ -32,7 +32,7 @@ def get_image(img, cache_dir): image = pathlib.Path(img) if image.is_file(): - wal_img = image + wal_img = str(image) elif image.is_dir(): wal_img = get_random_image(image, cache_dir) @@ -41,5 +41,8 @@ def get_image(img, cache_dir): print("error: No valid image file found.") exit(1) + # Cache the image file path. + util.save_file(wal_img, cache_dir / "wal") + print("image: Using image", wal_img) - return str(wal_img) + return wal_img diff --git a/pywal/magic.py b/pywal/magic.py index 5768c71..b384b97 100644 --- a/pywal/magic.py +++ b/pywal/magic.py @@ -49,8 +49,6 @@ def gen_colors(img, color_count): def get_colors(img, cache_dir, color_count, quiet): """Get the colorscheme.""" - util.save_file(img, cache_dir / "wal") - # _home_dylan_img_jpg.json cache_file = cache_dir / "schemes" / \ img.replace("/", "_").replace(".", "_") |
