From 032a559b3b1101adb7eb48d96dcd722fb2a9b0e2 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 14 Jul 2017 14:54:06 +0200 Subject: [PATCH] add reverse option --- prosopopee/prosopopee.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 12f4ce1..008a7ba 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -514,9 +514,9 @@ def build_index(settings, galleries_cover, templates, gallery_path='', sub_index reverse = gallery_settings.get('reverse', settings.get('reverse', True)) if reverse: - galleries_cover = reversed(sorted(filter(lambda x: x != {}, galleries_cover), key=lambda x: x["date"])) + galleries_cover = reversed(sorted([x for x in galleries_cover if x != {}], key=lambda x: x["date"])) else: - galleries_cover = sorted(filter(lambda x: x != {}, galleries_cover), key=lambda x: x["date"]) + galleries_cover = sorted([x for x in galleries_cover if x != {}], key=lambda x: x["date"]) # this should probably be a factory Image.base_dir = Path(".").joinpath(gallery_path)