From 719b994c07f438def6e9cd05e465531751269c31 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 23 Feb 2016 06:00:57 +0100 Subject: [PATCH] [enh] add error in case theme doesn't exist --- prosopopee/prosopopee.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 5bb31f6..1166a66 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -112,6 +112,8 @@ def main(): theme = settings.get("settings", {}).get("theme", "exposure") + error(os.path.exists(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", theme)), "'%s' is not an existing theme, available themes are '%s'" % (theme, "', '".join(os.listdir(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes"))))) + templates = Environment(loader=FileSystemLoader([os.path.realpath(os.path.join(os.getcwd(), "templates")), os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", theme, "templates")])) index_template = templates.get_template("index.html") gallery_index_template = templates.get_template("gallery-index.html")