From de34cf95b5a454ad1860039f1c08d812a0f6795b Mon Sep 17 00:00:00 2001 From: equinox Date: Thu, 27 Sep 2012 00:28:24 +0000 Subject: updated flufig structure git-svn-id: https://svn.spreadspace.org/flufigut/trunk@8 88d0365b-309c-4eec-8061-d8e0c04ad69e --- src/flufig.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/flufig.py b/src/flufig.py index ea1a4fa..3c095f5 100755 --- a/src/flufig.py +++ b/src/flufig.py @@ -33,11 +33,16 @@ from exceptions import * from jinja2 import Environment, FileSystemLoader if len(sys.argv) <= 2: - raise SystemExit("No template and or data file given") + raise SystemExit("No template name and or config file given") + +cf = open(sys.argv[2], 'r') +config = json.load(cf); +cf.close(); + +data = { 'globals' : config['globals'], 'atmosphere' : {}, 'flow' : {} } + +# TODO: implement generation of atmosphere and flow -df = open(sys.argv[2], 'r') -data = json.load(df); -df.close(); env = Environment(loader=FileSystemLoader('../templates/%s/' % (sys.argv[1]))) template = env.get_template('planet.xml') planet = template.render(globals=data['globals'], atmosphere=data['atmosphere'], flow=data['flow']) -- cgit v1.2.3