Add templating folder and stub files/templates.

This commit is contained in:
Kegan Dougal 2015-05-19 11:22:33 +01:00
parent bfec7752cb
commit 0b8b77697b
3 changed files with 46 additions and 0 deletions

18
templating/build.py Normal file
View file

@ -0,0 +1,18 @@
from jinja2 import Environment, FileSystemLoader
import json
def jsonify(input):
return json.dumps(input, indent=4)
env = Environment(loader=FileSystemLoader("templates"))
env.filters["jsonify"] = jsonify
example = {}
with open("../example.json", "r") as f:
example = json.loads(f.read())
event = {}
with open("../event_schema.json", "r") as f:
event = json.loads(f.read())
template = env.get_template("events.tmpl")
print template.render(example=example, event=event)