(self, environment, name, globals=None)
| 464 | |
| 465 | @internalcode |
| 466 | def load(self, environment, name, globals=None): |
| 467 | key = self.get_template_key(name) |
| 468 | module = '%s.%s' % (self.package_name, key) |
| 469 | mod = getattr(self.module, module, None) |
| 470 | if mod is None: |
| 471 | try: |
| 472 | mod = __import__(module, None, None, ['root']) |
| 473 | except ImportError: |
| 474 | raise TemplateNotFound(name) |
| 475 | |
| 476 | # remove the entry from sys.modules, we only want the attribute |
| 477 | # on the module object we have stored on the loader. |
| 478 | sys.modules.pop(module, None) |
| 479 | |
| 480 | return environment.template_class.from_module_dict( |
| 481 | environment, mod.__dict__, globals) |
nothing calls this directly
no test coverage detected