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

Method get_source

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

Source from the content-addressed store, hash-verified

165 self.followlinks = followlinks
166
167 def get_source(self, environment, template):
168 pieces = split_template_path(template)
169 for searchpath in self.searchpath:
170 filename = path.join(searchpath, *pieces)
171 f = open_if_exists(filename)
172 if f is None:
173 continue
174 try:
175 contents = f.read().decode(self.encoding)
176 finally:
177 f.close()
178
179 mtime = path.getmtime(filename)
180
181 def uptodate():
182 try:
183 return path.getmtime(filename) == mtime
184 except OSError:
185 return False
186 return contents, filename, uptodate
187 raise TemplateNotFound(template)
188
189 def list_templates(self):
190 found = set()

Callers

nothing calls this directly

Calls 7

open_if_existsFunction · 0.90
TemplateNotFoundClass · 0.90
split_template_pathFunction · 0.70
decodeMethod · 0.65
closeMethod · 0.65
joinMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected