From 0f33a8e24ab6cdac77b8d3844c4340b1c5197c9a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 8 Dec 2015 07:11:55 +0100 Subject: [PATCH] [enh] list galleries dir --- prosopopoee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prosopopoee b/prosopopoee index 30eb393..242e1e7 100755 --- a/prosopopoee +++ b/prosopopoee @@ -12,6 +12,12 @@ def main(): settings = yaml.safe_load("settings.yaml") + 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())) + + if not dirs: + sys.stderr.write("I can't find at least one directory with a settings.yaml in the current working directory, you don't have any gallery?\nAbort\n") + sys.exit(1) + if not os.path.exists("build"): os.makedirs("build")