MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / glob

Method glob

tools/python-3.11.9-amd64/Lib/pathlib.py:940–954  ·  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)

Source from the content-addressed store, hash-verified

938 return os.scandir(self)
939
940 def glob(self, pattern):
941 """Iterate over this subtree and yield all existing files (of any
942 kind, including directories) matching the given relative pattern.
943 """
944 sys.audit("pathlib.Path.glob", self, pattern)
945 if not pattern:
946 raise ValueError("Unacceptable pattern: {!r}".format(pattern))
947 drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
948 if drv or root:
949 raise NotImplementedError("Non-relative patterns are unsupported")
950 if pattern[-1] in (self._flavour.sep, self._flavour.altsep):
951 pattern_parts.append('')
952 selector = _make_selector(tuple(pattern_parts), self._flavour)
953 for p in selector.select_from(self):
954 yield p
955
956 def rglob(self, pattern):
957 """Recursively yield all existing files (of any kind, including

Callers 6

_find_grail_rcMethod · 0.45
testallFunction · 0.45
_complete_locationMethod · 0.45
testallFunction · 0.45
getFilesForNameFunction · 0.45
verify_wheelFunction · 0.45

Calls 6

_make_selectorFunction · 0.85
tupleClass · 0.85
parse_partsMethod · 0.80
formatMethod · 0.45
appendMethod · 0.45
select_fromMethod · 0.45

Tested by

no test coverage detected