MCPcopy Index your code
hub / github.com/RustPython/RustPython / glob

Method glob

Lib/pathlib/types.py:281–295  ·  view source on GitHub ↗

Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.

(self, pattern, *, recurse_symlinks=True)

Source from the content-addressed store, hash-verified

279 raise NotImplementedError
280
281 def glob(self, pattern, *, recurse_symlinks=True):
282 """Iterate over this subtree and yield all existing files (of any
283 kind, including directories) matching the given relative pattern.
284 """
285 anchor, parts = _explode_path(pattern, self.parser.split)
286 if anchor:
287 raise NotImplementedError("Non-relative patterns are unsupported")
288 elif not parts:
289 raise ValueError(f"Unacceptable pattern: {pattern!r}")
290 elif not recurse_symlinks:
291 raise NotImplementedError("recurse_symlinks=False is unsupported")
292 case_sensitive = self.parser.normcase('Aa') == 'Aa'
293 globber = _PathGlobber(self.parser.sep, case_sensitive, recursive=True)
294 select = globber.selector(parts)
295 return select(self.joinpath(''))
296
297 def walk(self, top_down=True, on_error=None, follow_symlinks=False):
298 """Walk the directory tree from this directory, similar to os.walk()."""

Callers

nothing calls this directly

Calls 6

_PathGlobberClass · 0.90
_explode_pathFunction · 0.85
normcaseMethod · 0.80
selectorMethod · 0.80
selectFunction · 0.50
joinpathMethod · 0.45

Tested by

no test coverage detected