(cls, environment, namespace, globals)
| 969 | |
| 970 | @classmethod |
| 971 | def _from_namespace(cls, environment, namespace, globals): |
| 972 | t = object.__new__(cls) |
| 973 | t.environment = environment |
| 974 | t.globals = globals |
| 975 | t.name = namespace['name'] |
| 976 | t.filename = namespace['__file__'] |
| 977 | t.blocks = namespace['blocks'] |
| 978 | |
| 979 | # render function and module |
| 980 | t.root_render_func = namespace['root'] |
| 981 | t._module = None |
| 982 | |
| 983 | # debug and loader helpers |
| 984 | t._debug_info = namespace['debug_info'] |
| 985 | t._uptodate = None |
| 986 | |
| 987 | # store the reference |
| 988 | namespace['environment'] = environment |
| 989 | namespace['__jinja_template__'] = t |
| 990 | |
| 991 | return t |
| 992 | |
| 993 | def render(self, *args, **kwargs): |
| 994 | """This method accepts the same arguments as the `dict` constructor: |
no test coverage detected