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

Function iglob

tools/python-3.11.9-amd64/Lib/glob.py:31–58  ·  view source on GitHub ↗

Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive i

(pathname, *, root_dir=None, dir_fd=None, recursive=False,
          include_hidden=False)

Source from the content-addressed store, hash-verified

29 include_hidden=include_hidden))
30
31def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
32 include_hidden=False):
33 """Return an iterator which yields the paths matching a pathname pattern.
34
35 The pattern may contain simple shell-style wildcards a la
36 fnmatch. However, unlike fnmatch, filenames starting with a
37 dot are special cases that are not matched by '*' and '?'
38 patterns.
39
40 If recursive is true, the pattern '**' will match any files and
41 zero or more directories and subdirectories.
42 """
43 sys.audit("glob.glob", pathname, recursive)
44 sys.audit("glob.glob/2", pathname, recursive, root_dir, dir_fd)
45 if root_dir is not None:
46 root_dir = os.fspath(root_dir)
47 else:
48 root_dir = pathname[:0]
49 it = _iglob(pathname, root_dir, dir_fd, recursive, False,
50 include_hidden=include_hidden)
51 if not pathname or recursive and _isrecursive(pathname[:2]):
52 try:
53 s = next(it) # skip empty string
54 if s:
55 it = itertools.chain((s,), it)
56 except StopIteration:
57 pass
58 return it
59
60def _iglob(pathname, root_dir, dir_fd, recursive, dironly,
61 include_hidden=False):

Callers 1

globFunction · 0.70

Calls 3

chainMethod · 0.80
_iglobFunction · 0.70
_isrecursiveFunction · 0.70

Tested by

no test coverage detected