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

Method get_source

tools/inspector_protocol/jinja2/loaders.py:231–248  ·  view source on GitHub ↗
(self, environment, template)

Source from the content-addressed store, hash-verified

229 self.package_path = package_path
230
231 def get_source(self, environment, template):
232 pieces = split_template_path(template)
233 p = '/'.join((self.package_path,) + tuple(pieces))
234 if not self.provider.has_resource(p):
235 raise TemplateNotFound(template)
236
237 filename = uptodate = None
238 if self.filesystem_bound:
239 filename = self.provider.get_resource_filename(self.manager, p)
240 mtime = path.getmtime(filename)
241 def uptodate():
242 try:
243 return path.getmtime(filename) == mtime
244 except OSError:
245 return False
246
247 source = self.provider.get_resource_string(self.manager, p)
248 return source.decode(self.encoding), filename, uptodate
249
250 def list_templates(self):
251 path = self.package_path

Callers

nothing calls this directly

Calls 4

TemplateNotFoundClass · 0.90
split_template_pathFunction · 0.70
decodeMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected