diff options
Diffstat (limited to 'lab')
-rw-r--r-- | lab/parse_all.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lab/parse_all.py b/lab/parse_all.py new file mode 100644 index 00000000..37606838 --- /dev/null +++ b/lab/parse_all.py @@ -0,0 +1,19 @@ +"""Parse every Python file in a tree.""" + +import os +import sys + +from coverage.misc import CoverageException +from coverage.parser import PythonParser + +for root, dirnames, filenames in os.walk(sys.argv[1]): + for filename in filenames: + if filename.endswith(".py"): + filename = os.path.join(root, filename) + print(":: {}".format(filename)) + try: + par = PythonParser(filename=filename) + par.parse_source() + par.arcs() + except Exception as exc: + print(" ** {}".format(exc)) |