summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorequinox <equinox@88d0365b-309c-4eec-8061-d8e0c04ad69e>2012-09-27 00:28:24 +0000
committerequinox <equinox@88d0365b-309c-4eec-8061-d8e0c04ad69e>2012-09-27 00:28:24 +0000
commitde34cf95b5a454ad1860039f1c08d812a0f6795b (patch)
tree85db388bb73b365e535649fd28e29f1c06995e1e
parentjson format first proposal (diff)
updated flufig structure
git-svn-id: https://svn.spreadspace.org/flufigut/trunk@8 88d0365b-309c-4eec-8061-d8e0c04ad69e
-rwxr-xr-xsrc/flufig.py13
1 files 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'])