MCPcopy Create free account
hub / github.com/ArthurHeitmann/arctic_shift / processFolder

Function processFolder

scripts/processFiles.py:44–58  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

42
43
44def processFolder(path: str):
45 fileIterator: Iterable[str]
46 if recursive:
47 def recursiveFileIterator():
48 for root, dirs, files in os.walk(path):
49 for file in files:
50 yield os.path.join(root, file)
51 fileIterator = recursiveFileIterator()
52 else:
53 fileIterator = os.listdir(path)
54 fileIterator = (os.path.join(path, file) for file in fileIterator)
55
56 for i, file in enumerate(fileIterator):
57 print(f"Processing file {i+1: 3} {file}")
58 processFile(file)
59
60def main():
61 if os.path.isdir(fileOrFolderPath):

Callers 1

mainFunction · 0.85

Calls 2

recursiveFileIteratorFunction · 0.85
processFileFunction · 0.85

Tested by

no test coverage detected