MCPcopy Index your code
hub / github.com/cool-RR/PySnooper / glob

Method glob

tests/mini_toolbox/pathlib.py:1290–1302  ·  view source on GitHub ↗

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

(self, pattern)

Source from the content-addressed store, hash-verified

1288 self._raise_closed()
1289
1290 def glob(self, pattern):
1291 """Iterate over this subtree and yield all existing files (of any
1292 kind, including directories) matching the given pattern.
1293 """
1294 if not pattern:
1295 raise ValueError("Unacceptable pattern: {0!r}".format(pattern))
1296 pattern = self._flavour.casefold(pattern)
1297 drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
1298 if drv or root:
1299 raise NotImplementedError("Non-relative patterns are unsupported")
1300 selector = _make_selector(tuple(pattern_parts))
1301 for p in selector.select_from(self):
1302 yield p
1303
1304 def rglob(self, pattern):
1305 """Recursively yield all existing files (of any kind, including

Callers

nothing calls this directly

Calls 4

_make_selectorFunction · 0.85
parse_partsMethod · 0.80
select_fromMethod · 0.80
casefoldMethod · 0.45

Tested by

no test coverage detected