From 34db72cffa0735cf76fde7578aad68de1a63bb93 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Sun, 4 Jun 2017 16:15:37 +0200 Subject: [PATCH 01/12] better catch error --- prosopopee/prosopopee.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 0be5fae..f0c06d8 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -357,7 +357,14 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p else: gallery_path = gallery_name - gallery_settings = yaml.safe_load(open(Path(".").joinpath(gallery_path, "settings.yaml").abspath(), "r")) + try: + gallery_settings = yaml.load(open(Path(".").joinpath(gallery_path, "settings.yaml").abspath(), "r")) + except yaml.YAMLError, exc: + if hasattr(exc, 'problem_mark'): + mark = exc.problem_mark + error(False, "There are something wrong in %s/settings.yaml line %s" % (gallery_path, mark.line+1)) + else: + erro(False, "There are omething wrong in %s/settings.yaml" % (gallery_path)) error(isinstance(gallery_settings, dict), "Your %s should be a dict" % gallery_name.joinpath("settings.yaml")) error(gallery_settings.get("title"), "You should specify a title in %s" % gallery_name.joinpath("settings.yaml")) From 59f96c0b240ffe1e9466fe9f8f22f17db2a35d5e Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Sun, 4 Jun 2017 16:28:09 +0200 Subject: [PATCH 02/12] add background color for audio player --- docs/sections.rst | 1 + prosopopee/themes/exposure/templates/sections/audio.html | 2 +- prosopopee/themes/material/templates/sections/audio.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sections.rst b/docs/sections.rst index fe718cf..8ca16e5 100644 --- a/docs/sections.rst +++ b/docs/sections.rst @@ -151,6 +151,7 @@ This section is for add audio file with HTML5 player.:: - type: audio title: Title of song image: song.ogg + color: "#000" (optional) Author diff --git a/prosopopee/themes/exposure/templates/sections/audio.html b/prosopopee/themes/exposure/templates/sections/audio.html index cf99913..7cb88b2 100644 --- a/prosopopee/themes/exposure/templates/sections/audio.html +++ b/prosopopee/themes/exposure/templates/sections/audio.html @@ -6,7 +6,7 @@ {% set format = extension %} {% endif %} {{ audio.copy() }} -
+

{% if section.title %}{{ section.title }}{% else %}{{ audio }}{% endif %}