summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'])