From 45352088f429ecf94c9c727742ea98d2a5fd9c76 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 1 Nov 2016 10:51:05 +0100 Subject: [PATCH] [enh] make code more lisibile --- prosopopee/prosopopee.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 8b24f01..c16ab1f 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -290,7 +290,7 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p gallery_cover = {} - sub_galleries = filter(lambda x: x.joinpath("settings.yaml").exists(), Path(".").joinpath(gallery_path).listdir()) + sub_galleries = [x.joinpath("settings.yaml") for x in Path(".").joinpath(gallery_path).listdir() if x.joinpath("settings.yaml").exists()] Path("build").joinpath(gallery_path).makedirs_p() @@ -432,7 +432,7 @@ def main(): front_page_galleries_cover = [] - galleries_dirs = filter(lambda x: x.joinpath("settings.yaml").exists(), Path(".").listdir()) + galleries_dirs = [x.joinpath("settings.yaml") for x in Path(".").listdir() if x.joinpath("settings.yaml").exists()] error(galleries_dirs, "I can't find at least one directory with a settings.yaml in the current working " "directory (NOT the settings.yaml in your current directory, but one INSIDE A "