[mod] simplify code

This commit is contained in:
Laurent Peuch 2016-02-16 08:43:46 +01:00
parent c1b25f5189
commit 4dcce1fcd2

View File

@ -155,18 +155,12 @@ def main():
cover_image_path = os.path.join(gallery, gallery_settings["cover"]) cover_image_path = os.path.join(gallery, gallery_settings["cover"])
error(os.path.exists(cover_image_path), "File for %s cover image doesn't exists at %s" % (gallery, cover_image_path)) error(os.path.exists(cover_image_path), "File for %s cover image doesn't exists at %s" % (gallery, cover_image_path))
gallery_title = gallery_settings["title"]
gallery_sub_title = gallery_settings.get("sub_title", "")
gallery_date = gallery_settings["date"] if "date" in gallery_settings else ""
gallery_tags = gallery_settings["tags"] if "tags" in gallery_settings else ""
if gallery_settings.get("public", True):
front_page_galleries_cover.append({ front_page_galleries_cover.append({
"title": gallery_title, "title": gallery_settings["title"],
"link": gallery, "link": gallery,
"sub_title": gallery_sub_title, "sub_title": gallery_settings.get("sub_title", ""),
"date": gallery_date, "date": gallery_settings.get("date", ""),
"tags": gallery_tags, "tags": gallery_settings.get("tags", ""),
"cover": cover_image_path, "cover": cover_image_path,
}) })