The template as module. This is used for imports in the template runtime but is also useful if one wants to access exported template variables from the Python layer: >>> t = Template('{% macro foo() %}42{% endmacro %}23') >>> str(t.module) '23' >>> t
(self)
| 1091 | |
| 1092 | @property |
| 1093 | def module(self): |
| 1094 | """The template as module. This is used for imports in the |
| 1095 | template runtime but is also useful if one wants to access |
| 1096 | exported template variables from the Python layer: |
| 1097 | |
| 1098 | >>> t = Template('{% macro foo() %}42{% endmacro %}23') |
| 1099 | >>> str(t.module) |
| 1100 | '23' |
| 1101 | >>> t.module.foo() == u'42' |
| 1102 | True |
| 1103 | |
| 1104 | This attribute is not available if async mode is enabled. |
| 1105 | """ |
| 1106 | return self._get_default_module() |
| 1107 | |
| 1108 | def get_corresponding_lineno(self, lineno): |
| 1109 | """Return the source line number of a line number in the |
no test coverage detected