Print found directories

TODO: Move to different method, since this way lower depth images are
preferred
This commit is contained in:
Lorenz Leitner 2019-03-14 20:20:33 +01:00
parent c823e3c9db
commit e10337c838

View File

@ -31,7 +31,10 @@ def get_random_image(img_dir):
images.remove(current_wall) images.remove(current_wall)
elif not images: 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) sys.exit(1)
random.shuffle(images) random.shuffle(images)
@ -59,7 +62,7 @@ def get_next_image(img_dir):
return os.path.join(img_dir, image) 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.""" """Validate image input."""
if os.path.isfile(img): if os.path.isfile(img):
wal_img = img wal_img = img