(self, path)
| 434 | has_source_access = False |
| 435 | |
| 436 | def __init__(self, path): |
| 437 | package_name = '_jinja2_module_templates_%x' % id(self) |
| 438 | |
| 439 | # create a fake module that looks for the templates in the |
| 440 | # path given. |
| 441 | mod = _TemplateModule(package_name) |
| 442 | if isinstance(path, string_types): |
| 443 | path = [path] |
| 444 | else: |
| 445 | path = list(path) |
| 446 | mod.__path__ = path |
| 447 | |
| 448 | sys.modules[package_name] = weakref.proxy(mod, |
| 449 | lambda x: sys.modules.pop(package_name, None)) |
| 450 | |
| 451 | # the only strong reference, the sys.modules entry is weak |
| 452 | # so that the garbage collector can remove it once the |
| 453 | # loader that created it goes out of business. |
| 454 | self.module = mod |
| 455 | self.package_name = package_name |
| 456 | |
| 457 | @staticmethod |
| 458 | def get_template_key(name): |
nothing calls this directly
no test coverage detected