INNER CODE UNIT · Python
collect_files
Cooler2/ApusGameEngine · tools/normalize_indent.py:309
def collect_files(root, include_extra, include_tmp):
result = []
for dirpath, dirs, files in os.walk(root):
# Prune unwanted dirs in-place
skip = set(SKIP_DIRS)
if not include_extra:
skip.add('extra')
if not include_tmp:
skip.add('tmp')
dirs[:] = [d for d in dirs if d not in skip]
for fname in files:
if fname.lower().endswith('.pas'):
result.append(os.path.join(dirpath, fname))
return result
# ---------------------------------------------------------------------------