Reprepro working

This commit is contained in:
Max Fowler
2020-11-12 17:21:48 +01:00
parent e9feefa035
commit fed137f82d
10 changed files with 6 additions and 78 deletions

View File

@ -7,7 +7,7 @@ print('PROJECT_PATH: {}'.format(PROJECT_PATH))
template_path = os.path.join(PROJECT_PATH, 'conf/templates')
template_loader = jinja2.FileSystemLoader(searchpath=template_path)
template_env = jinja2.Environment(loader=template_loader)
template_env = jinja2.Environment(loader=template_loader, keep_trailing_newline=True)
def render_template(src, dest, template_vars=None):
@ -20,7 +20,7 @@ def render_template(src, dest, template_vars=None):
template = template_env.get_template(src)
if not template_vars:
template_vars= {}
output_text = template.render(template_vars=template_vars)
output_text = template.render(**template_vars)
if os.path.exists(dest):
os.remove(dest)
with open(dest, 'w') as f: