radiaSRT/print/make_html.py

17 lines
376 B
Python
Raw Normal View History

2012-01-27 16:31:00 +00:00
from jinja2 import Template
from os.path import join
import json
import codecs
def do():
data = json.load(open("chronoPrint.json"))
i = 1
for d in data:
d['serial'] = i
i += 1
t = Template(open("template.html").read())
s = t.render({'files': data})
out = codecs.open("out.html", "w", encoding="utf-8")
out.write(s)
out.close()