parent
b7c110e5ec
commit
d27890d98d
@ -1,17 +1,20 @@
|
|||||||
import glob
|
import glob
|
||||||
import py_compile as pyc
|
import py_compile as pyc
|
||||||
|
|
||||||
src_paths = sorted(glob.glob("codes/python/**/*.py"))
|
if __name__ == "__main__":
|
||||||
num_src = len(src_paths)
|
# find source code files
|
||||||
num_src_error = 0
|
src_paths = sorted(glob.glob("codes/python/**/*.py"))
|
||||||
|
num_src = len(src_paths)
|
||||||
|
num_src_error = 0
|
||||||
|
|
||||||
for src_path in src_paths:
|
# compile python code
|
||||||
|
for src_path in src_paths:
|
||||||
try:
|
try:
|
||||||
pyc.compile(src_path, doraise=True)
|
pyc.compile(src_path, doraise=True)
|
||||||
except pyc.PyCompileError as e:
|
except pyc.PyCompileError as e:
|
||||||
num_src_error += 1
|
num_src_error += 1
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
print(f"===== Build Summary =====")
|
print(f"===== Build Complete =====")
|
||||||
print(f"Total: {num_src}")
|
print(f"Total: {num_src}")
|
||||||
print(f"Error: {num_src - num_src_error}")
|
print(f"Error: {num_src_error}")
|
||||||
|
Loading…
Reference in new issue