From 7a1bdb033d92b65bbab0e056d51ccb9452e27703 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 8 Dec 2015 07:26:55 +0100 Subject: [PATCH] [enh] better checks on settings.yaml --- prosopopoee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prosopopoee b/prosopopoee index 108a8db..9c152f5 100755 --- a/prosopopoee +++ b/prosopopoee @@ -12,7 +12,10 @@ def main(): settings = yaml.safe_load("settings.yaml") + assert isinstance(settings, dict), "Your settings.yaml should be a dict" assert settings.get("title"), "You should specify a title in your main settings.yaml" + title = settings["title"] + sub_title = settings.get("sub_title", "") dirs = filter(lambda x: x not in (".", "..") and os.path.isdir(x) and os.path.exists(os.path.join(os.getcwd(), x, "settings.yaml")), os.listdir(os.getcwd()))