Simple replace wrapper template variables instead of python formatting to allow use braces
This commit is contained in:
parent
b0a8c4d278
commit
3e970df09b
1 changed files with 4 additions and 2 deletions
|
@ -245,8 +245,10 @@ class UiRequest(object):
|
||||||
|
|
||||||
# Renders a template
|
# Renders a template
|
||||||
def render(self, template_path, *args, **kwargs):
|
def render(self, template_path, *args, **kwargs):
|
||||||
template = open(template_path).read().decode("utf8")
|
template = open(template_path).read()
|
||||||
return template.format(**kwargs).encode("utf8")
|
for key, val in kwargs.items():
|
||||||
|
template = template.replace("{%s}" % key, "%s" % val)
|
||||||
|
return template
|
||||||
|
|
||||||
# - Actions -
|
# - Actions -
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue