[enh] better checks on settings.yaml

This commit is contained in:
Laurent Peuch 2015-12-08 07:26:55 +01:00
parent a816cb1497
commit 7a1bdb033d

View File

@ -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()))