diff options
author | Matt Turner <mattst88@gentoo.org> | 2020-04-15 12:55:00 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2020-04-15 12:57:37 -0700 |
commit | 32d11d799bbb899f3418297462089a22ba13cf53 (patch) | |
tree | 43a4cc49191846184c7b3367c3ac135ae711bf08 /bin | |
parent | catalyst: Remove dead base_dirs() function (diff) | |
download | catalyst-32d11d799bbb899f3418297462089a22ba13cf53.tar.gz catalyst-32d11d799bbb899f3418297462089a22ba13cf53.tar.bz2 catalyst-32d11d799bbb899f3418297462089a22ba13cf53.zip |
catalyst: Run autopep8
The only change I reverted was from the reformatting of the
HASH_DEFINITIONS table in catalyst/hash_utils.py.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/catalyst | 28 | ||||
-rwxr-xr-x | bin/pylint | 47 |
2 files changed, 38 insertions, 37 deletions
diff --git a/bin/catalyst b/bin/catalyst index 97cbb0f9..e464d369 100755 --- a/bin/catalyst +++ b/bin/catalyst @@ -4,28 +4,28 @@ import sys # This block ensures that ^C interrupts are handled quietly. try: - import signal + import signal - def exithandler(_signum, _frame): - signal.signal(signal.SIGINT, signal.SIG_IGN) - signal.signal(signal.SIGTERM, signal.SIG_IGN) - print() - sys.exit(1) + def exithandler(_signum, _frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + print() + sys.exit(1) - signal.signal(signal.SIGINT, exithandler) - signal.signal(signal.SIGTERM, exithandler) - signal.signal(signal.SIGPIPE, signal.SIG_DFL) + signal.signal(signal.SIGINT, exithandler) + signal.signal(signal.SIGTERM, exithandler) + signal.signal(signal.SIGPIPE, signal.SIG_DFL) except KeyboardInterrupt: - print() - sys.exit(1) + print() + sys.exit(1) from catalyst.main import main try: - main(sys.argv[1:]) + main(sys.argv[1:]) except KeyboardInterrupt: - print("Aborted.") - sys.exit(130) + print("Aborted.") + sys.exit(130) sys.exit(0) @@ -9,38 +9,39 @@ import sys def find_all_modules(source_root): - """Locate all python modules in the tree for scanning""" - ret = [] + """Locate all python modules in the tree for scanning""" + ret = [] - for root, _dirs, files in os.walk(source_root, topdown=False): - # Add all of the .py modules in the tree. - ret += [os.path.join(root, x) for x in files if x.endswith('.py')] + for root, _dirs, files in os.walk(source_root, topdown=False): + # Add all of the .py modules in the tree. + ret += [os.path.join(root, x) for x in files if x.endswith('.py')] - # Add the main scripts that don't end in .py. - ret += [os.path.join(source_root, 'bin', x) for x in ('catalyst', 'pylint')] + # Add the main scripts that don't end in .py. + ret += [os.path.join(source_root, 'bin', x) + for x in ('catalyst', 'pylint')] - return ret + return ret def main(argv): - """The main entry point""" - source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + """The main entry point""" + source_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - if not argv: - argv = find_all_modules(source_root) + if not argv: + argv = find_all_modules(source_root) - pympath = source_root - pythonpath = os.environ.get('PYTHONPATH') - if pythonpath is None: - pythonpath = pympath - else: - pythonpath = pympath + ':' + pythonpath - os.environ['PYTHONPATH'] = pythonpath + pympath = source_root + pythonpath = os.environ.get('PYTHONPATH') + if pythonpath is None: + pythonpath = pympath + else: + pythonpath = pympath + ':' + pythonpath + os.environ['PYTHONPATH'] = pythonpath - pylintrc = os.path.join(source_root, '.pylintrc') - cmd = ['pylint', '--rcfile', pylintrc] - os.execvp(cmd[0], cmd + argv) + pylintrc = os.path.join(source_root, '.pylintrc') + cmd = ['pylint', '--rcfile', pylintrc] + os.execvp(cmd[0], cmd + argv) if __name__ == '__main__': - main(sys.argv[1:]) + main(sys.argv[1:]) |