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

Method list_templates

tools/inspector_protocol/jinja2/loaders.py:189–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

187 raise TemplateNotFound(template)
188
189 def list_templates(self):
190 found = set()
191 for searchpath in self.searchpath:
192 walk_dir = os.walk(searchpath, followlinks=self.followlinks)
193 for dirpath, dirnames, filenames in walk_dir:
194 for filename in filenames:
195 template = os.path.join(dirpath, filename) \
196 [len(searchpath):].strip(os.path.sep) \
197 .replace(os.path.sep, '/')
198 if template[:2] == './':
199 template = template[2:]
200 if template not in found:
201 found.add(template)
202 return sorted(found)
203
204
205class PackageLoader(BaseLoader):

Callers

nothing calls this directly

Calls 5

sortedFunction · 0.85
walkMethod · 0.80
addMethod · 0.65
setFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected