MCPcopy Create free account
hub / github.com/PyCQA/pyflakes / iterSourceCode

Function iterSourceCode

pyflakes/api.py:96–112  ·  view source on GitHub ↗

Iterate over all Python source files in C{paths}. @param paths: A list of paths. Directories will be recursed into and any .py files found will be yielded. Any non-directories will be yielded as-is.

(paths)

Source from the content-addressed store, hash-verified

94
95
96def iterSourceCode(paths):
97 """
98 Iterate over all Python source files in C{paths}.
99
100 @param paths: A list of paths. Directories will be recursed into and
101 any .py files found will be yielded. Any non-directories will be
102 yielded as-is.
103 """
104 for path in paths:
105 if os.path.isdir(path):
106 for dirpath, dirnames, filenames in os.walk(path):
107 for filename in filenames:
108 full_path = os.path.join(dirpath, filename)
109 if isPythonFile(full_path):
110 yield full_path
111 else:
112 yield path
113
114
115def checkRecursive(paths, reporter):

Callers 8

test_emptyDirectoryMethod · 0.90
test_singleFileMethod · 0.90
test_onlyPythonSourceMethod · 0.90
test_recursesMethod · 0.90
test_shebangMethod · 0.90
test_explicitFilesMethod · 0.90
checkRecursiveFunction · 0.85

Calls 1

isPythonFileFunction · 0.85

Tested by 7

test_emptyDirectoryMethod · 0.72
test_singleFileMethod · 0.72
test_onlyPythonSourceMethod · 0.72
test_recursesMethod · 0.72
test_shebangMethod · 0.72
test_explicitFilesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…