2014-01-28 15:25:40 +01:00
|
|
|
import sys
|
2014-01-28 15:49:52 +01:00
|
|
|
import subprocess
|
|
|
|
from pkg_resources import load_entry_point, DistributionNotFound
|
2014-01-28 15:25:40 +01:00
|
|
|
|
|
|
|
status = {}
|
|
|
|
|
|
|
|
def run(name, args=None):
|
|
|
|
sys.argv = [name, 'qutebrowser']
|
|
|
|
if args is not None:
|
|
|
|
sys.argv += args
|
|
|
|
print("====== {} ======".format(name))
|
|
|
|
try:
|
|
|
|
load_entry_point(name, 'console_scripts', name)()
|
|
|
|
except SystemExit as e:
|
|
|
|
status[name] = e
|
2014-01-28 15:49:52 +01:00
|
|
|
except DistributionNotFound:
|
|
|
|
if args is None:
|
|
|
|
args = []
|
|
|
|
try:
|
|
|
|
print('exc {}'.format([name, 'qutebrowser'] + args))
|
|
|
|
status[name] = subprocess.call([name] + args)
|
|
|
|
except FileNotFoundError as e:
|
|
|
|
print('{}: {}'.format(e.__class__.__name__, e))
|
|
|
|
status[name] = None
|
2014-01-28 15:25:40 +01:00
|
|
|
except Exception as e:
|
2014-01-28 15:50:11 +01:00
|
|
|
print('{}: {}'.format(e.__class__.__name__, e))
|
2014-01-28 15:25:40 +01:00
|
|
|
status[name] = None
|
|
|
|
print()
|
|
|
|
|
|
|
|
run('pylint')
|
|
|
|
run('flake8', ['--max-complexity', '10'])
|
|
|
|
|
|
|
|
print('Exit status values:')
|
|
|
|
for (k, v) in status.items():
|
|
|
|
print(' {} - {}'.format(k, v))
|