|
@@ -23,16 +23,28 @@ def check_style(fpath): |
|
|
|
return style.check_files([fpath]) |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
def package_files(package_dir): |
|
|
|
def path(ext): |
|
|
|
return os.path.join(package_dir, '**/*'+ext) |
|
|
|
|
|
|
|
fpaths = list(chain.from_iterable( |
|
|
|
(glob.iglob(path(ext), recursive=True) for ext in EXTS) |
|
|
|
)) |
|
|
|
setup_py = os.path.join(package_dir, '../setup.py') |
|
|
|
fpaths.append(setup_py) |
|
|
|
return fpaths |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
dir_name = argv[1] |
|
|
|
script_dir = os.path.join(dir_name, 'bin') |
|
|
|
package_dir = os.path.join(dir_name, 'scientific_python') |
|
|
|
book_dir = os.path.join(dir_name, 'misc/book') |
|
|
|
sample_proj_dir = os.path.join(dir_name, 'misc/sample_project/ser') |
|
|
|
|
|
|
|
fpaths = [os.path.join(script_dir, script) for script in SCRIPTS] |
|
|
|
fpaths += list(chain.from_iterable( |
|
|
|
(glob.iglob(os.path.join(package_dir, '**/*'+ext)) for ext in EXTS) |
|
|
|
)) |
|
|
|
fpaths += package_files(package_dir) |
|
|
|
fpaths += package_files(sample_proj_dir) |
|
|
|
fpaths += glob.glob(os.path.join(book_dir, '*.py')) |
|
|
|
print(fpaths) |
|
|
|
|
|
@@ -56,3 +68,7 @@ if __name__ == '__main__': |
|
|
|
raise RuntimeError(msg) |
|
|
|
else: |
|
|
|
print("Style check hasn't found any errors") |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
main() |
0 comments on commit
2f19da7