diff options
author | Jack Lloyd <[email protected]> | 2017-12-04 10:59:50 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-04 10:59:50 -0500 |
commit | 6713f6363033ed45d7ced49c2e8cb6240334ea7a (patch) | |
tree | 65f50561c91035f69cd62bc70aa210e2f755856d | |
parent | 6289204717f39cb7e5d292cb419afbb86af5dbab (diff) |
Lint fixes
-rwxr-xr-x | src/scripts/build_docs.py | 2 | ||||
-rwxr-xr-x | src/scripts/cleanup.py | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/scripts/build_docs.py b/src/scripts/build_docs.py index b30e3d3e1..c6b8e9f67 100755 --- a/src/scripts/build_docs.py +++ b/src/scripts/build_docs.py @@ -48,7 +48,7 @@ def run_and_check(cmd_line): proc = subprocess.Popen(cmd_line, close_fds=True) - (stdout, stderr) = proc.communicate() + proc.communicate() if proc.returncode != 0: logging.error("Error running %s", ' '.join(cmd_line)) diff --git a/src/scripts/cleanup.py b/src/scripts/cleanup.py index f14f6d9c1..ae2f588f5 100755 --- a/src/scripts/cleanup.py +++ b/src/scripts/cleanup.py @@ -43,10 +43,7 @@ def remove_all_in_dir(d): for f in os.listdir(d): remove_file(os.path.join(d, f)) -def main(args=None): - if args is None: - args = sys.argv - +def parse_options(args): parser = optparse.OptionParser() parser.add_option('--build-dir', default='build', metavar='DIR', help='specify build dir to clean (default %default)') @@ -58,14 +55,21 @@ def main(args=None): (options, args) = parser.parse_args(args) + if len(args) > 1: + raise Exception("Unknown arguments") + + return options + +def main(args=None): + if args is None: + args = sys.argv + + options = parse_options(args) + logging.basicConfig(stream=sys.stderr, format='%(levelname) 7s: %(message)s', level=logging.DEBUG if options.verbose else logging.INFO) - if len(args) > 1: - logging.error("Unknown arguments") - return 1 - build_dir = options.build_dir if os.access(build_dir, os.X_OK) != True: @@ -101,8 +105,6 @@ def main(args=None): except OSError: pass - #remove_file(build_config['doc_stamp_file']) - remove_file(build_config['cli_exe']) remove_file(build_config['test_exe']) |