mirror of
https://github.com/krateng/maloja.git
synced 2025-04-13 07:27:12 +03:00
25 lines
522 B
Python
25 lines
522 B
Python
import toml
|
|
import os
|
|
import jinja2
|
|
|
|
from pprint import pprint
|
|
|
|
with open("pyproject.toml") as filed:
|
|
data = toml.load(filed)
|
|
|
|
templatedir = "./dev/templates"
|
|
|
|
for templatefile in os.listdir(templatedir):
|
|
|
|
srcfile = os.path.join(templatedir,templatefile)
|
|
trgfile = os.path.join(".",templatefile.replace(".jinja",""))
|
|
|
|
with open(srcfile) as templatefiled:
|
|
template = jinja2.Template(templatefiled.read())
|
|
|
|
result = template.render(**data)
|
|
|
|
with open(trgfile,"w") as filed:
|
|
filed.write(result)
|
|
filed.write('\n')
|