fix string manipulation in render_templatefile()

This commit is contained in:
Νικόλαος-Διγενής Καραγιάννης 2015-05-06 22:36:14 +03:00
parent f5c54072ec
commit 56b3cf07ff
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ def render_templatefile(path, **kwargs):
content = string.Template(raw).substitute(**kwargs)
with open(path.rstrip('.tmpl'), 'wb') as file:
render_path = path[:-len('.tmpl')] if path.endswith('.tmpl') else path
with open(render_path, 'wb') as file:
file.write(content)
if path.endswith('.tmpl'):
os.remove(path)