Wrapper to the jinja2 render method from a template file Parameters ---------- template : str Path to template file. context : dict Dictionary with kwargs context to populate the template
(template, context)
| 400 | |
| 401 | @staticmethod |
| 402 | def render(template, context): |
| 403 | """Wrapper to the jinja2 render method from a template file |
| 404 | |
| 405 | Parameters |
| 406 | ---------- |
| 407 | template : str |
| 408 | Path to template file. |
| 409 | context : dict |
| 410 | Dictionary with kwargs context to populate the template |
| 411 | """ |
| 412 | |
| 413 | path, filename = os.path.split(template) |
| 414 | |
| 415 | return jinja2.Environment( |
| 416 | loader=jinja2.FileSystemLoader(path or './') |
| 417 | ).get_template(filename).render(context) |
| 418 | |
| 419 | @property |
| 420 | def template_str(self): |
no outgoing calls
no test coverage detected