(
cls,
environment: Environment,
namespace: t.MutableMapping[str, t.Any],
globals: t.MutableMapping[str, t.Any],
)
| 1246 | |
| 1247 | @classmethod |
| 1248 | def _from_namespace( |
| 1249 | cls, |
| 1250 | environment: Environment, |
| 1251 | namespace: t.MutableMapping[str, t.Any], |
| 1252 | globals: t.MutableMapping[str, t.Any], |
| 1253 | ) -> "Template": |
| 1254 | t: Template = object.__new__(cls) |
| 1255 | t.environment = environment |
| 1256 | t.globals = globals |
| 1257 | t.name = namespace["name"] |
| 1258 | t.filename = namespace["__file__"] |
| 1259 | t.blocks = namespace["blocks"] |
| 1260 | |
| 1261 | # render function and module |
| 1262 | t.root_render_func = namespace["root"] |
| 1263 | t._module = None |
| 1264 | |
| 1265 | # debug and loader helpers |
| 1266 | t._debug_info = namespace["debug_info"] |
| 1267 | t._uptodate = None |
| 1268 | |
| 1269 | # store the reference |
| 1270 | namespace["environment"] = environment |
| 1271 | namespace["__jinja_template__"] = t |
| 1272 | |
| 1273 | return t |
| 1274 | |
| 1275 | def render(self, *args: t.Any, **kwargs: t.Any) -> str: |
| 1276 | """This method accepts the same arguments as the `dict` constructor: |
no test coverage detected