magcms/prosopopoee
2015-12-08 07:11:55 +01:00

27 lines
738 B
Python
Executable File

#!/usr/bin/env python
import os
import sys
import yaml
def main():
if not os.path.exists(os.path.join(os.getcwd(), "settings.yaml")):
sys.stderr.write("I can't find a settings.yaml, abort\n")
sys.exit(1)
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")
if __name__ == '__main__':
main()