MCPcopy Index your code
hub / github.com/python/cpython / findfiles

Function findfiles

Lib/idlelib/grep.py:48–61  ·  view source on GitHub ↗

Generate file names in dir that match pattern. Args: folder: Root directory to search. pattern: File pattern to match. recursive: True to include subdirectories.

(folder, pattern, recursive)

Source from the content-addressed store, hash-verified

46
47
48def findfiles(folder, pattern, recursive):
49 """Generate file names in dir that match pattern.
50
51 Args:
52 folder: Root directory to search.
53 pattern: File pattern to match.
54 recursive: True to include subdirectories.
55 """
56 for dirpath, _, filenames in os.walk(folder, onerror=walk_error):
57 yield from (os.path.join(dirpath, name)
58 for name in filenames
59 if fnmatch.fnmatch(name, pattern))
60 if not recursive:
61 break
62
63
64class GrepDialog(SearchDialogBase):

Callers 1

grep_itMethod · 0.85

Calls 3

fnmatchMethod · 0.80
walkMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…