MCPcopy Index your code
hub / github.com/StackStorm/st2 / _get_files

Function _get_files

tools/log_watcher.py:52–63  ·  view source on GitHub ↗
(dir_path)

Source from the content-addressed store, hash-verified

50
51
52def _get_files(dir_path):
53 if not os.path.exists(dir_path):
54 print("Directory %s doesn't exist." % dir_path)
55
56 files = []
57 exclude = set(["virtualenv", "build", ".tox"])
58 for root, dirnames, filenames in os.walk(dir_path):
59 dirnames[:] = [d for d in dirnames if d not in exclude]
60 for filename in fnmatch.filter(filenames, "*.py"):
61 if not _skip_file(filename):
62 files.append(os.path.join(root, filename))
63 return files
64
65
66# TODO: Regex compiling will be faster but I cannot get it to work :(

Callers 1

mainFunction · 0.85

Calls 3

_skip_fileFunction · 0.85
existsMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected