MCPcopy Index your code
hub / github.com/nodejs/node / __init__

Method __init__

tools/inspector_protocol/jinja2/loaders.py:436–455  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

popMethod · 0.80
_TemplateModuleClass · 0.70
idFunction · 0.50
listFunction · 0.50

Tested by

no test coverage detected