(filename, **context)
| 12 | |
| 13 | |
| 14 | def render(filename, **context): |
| 15 | try: |
| 16 | template = Template( |
| 17 | open(filename, "rb").read(), |
| 18 | filename=filename, |
| 19 | input_encoding="utf8", |
| 20 | strict_undefined=True, |
| 21 | ) |
| 22 | return template.render(**context) |
| 23 | except Exception: |
| 24 | # Uncomment to see a traceback in generated Python code: |
| 25 | # raise |
| 26 | abort(exceptions.text_error_template().render()) |
| 27 | |
| 28 | def write(path, content): |
| 29 | RE_PYTHON_ADDR = re.compile(r"<.+? object at 0x[0-9a-fA-F]+>") |
no test coverage detected