From e10337c838d088e3a8075c3f2771574bbf001a5d Mon Sep 17 00:00:00 2001 From: Lorenz Leitner Date: Thu, 14 Mar 2019 20:20:33 +0100 Subject: Print found directories TODO: Move to different method, since this way lower depth images are preferred --- pywal/image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pywal/image.py b/pywal/image.py index 897f443..63ab209 100644 --- a/pywal/image.py +++ b/pywal/image.py @@ -31,7 +31,10 @@ def get_random_image(img_dir): images.remove(current_wall) elif not images: - logging.error("No images found in directory.") + logging.error("No images found in directory, picking random directory.") + logging.info("Found dirs: {}".format([dir_file.name for dir_file in + os.scandir(img_dir)])) + sys.exit(1) random.shuffle(images) @@ -59,7 +62,7 @@ def get_next_image(img_dir): return os.path.join(img_dir, image) -def get(img, cache_dir=CACHE_DIR, iterative=False): +def get(img, cache_dir=CACHE_DIR, iterative=False, recursive=False): """Validate image input.""" if os.path.isfile(img): wal_img = img -- cgit v1.2.3