From 2dd49e5d73116a9156e5551b7f4243a67cf75140 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 1 Nov 2016 11:16:16 +0100 Subject: [PATCH] [mod] put simplifer case upfront --- prosopopee/prosopopee.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 2556979..7eab268 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -290,7 +290,10 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p else: gallery_cover = create_cover(gallery_name, gallery_settings, gallery_path) - if sub_galleries: + if not sub_galleries: + build_gallery(settings, gallery_settings, gallery_path, parent_templates) + + else: error(gallery_settings.get("sections") is not False, "The gallery in %s can't have both sections and subgalleries" % gallery_name.joinpath("settings.yaml")) @@ -307,9 +310,6 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p build_index(settings, sub_page_galleries_cover, subgallery_templates, gallery_path) gallery_cover['sub_gallery'] = sub_page_galleries_cover - else: - # No sub galleries found, create a gallery - build_gallery(settings, gallery_settings, gallery_path, parent_templates) return gallery_cover