Skip to content
Commits on Source (3)
......@@ -24,11 +24,14 @@ from unsupported_packages import UnsupportedPackages, LimitedSupportPackages
def colored(x, *args, **kwargs):
return x
colored_on = False
try:
if sys.stdout.isatty():
from termcolor import colored
colored_on = True
except ImportError:
print("Note: you can install python-termcolor for colored output")
pass
TRACKER_URL = 'https://security-tracker.debian.org/tracker/'
......@@ -149,12 +152,15 @@ for key, desc in LIST_NAMES:
continue
print('\n{}:'.format(colored(desc, attrs=('bold',))))
for pkg in sorted(lists[key].keys()):
print('\n* {:<35s} {}'.format(
formatstring = '\n* {:<18s} {}'
if colored_on:
formatstring = '\n* {:<35s} {}'
print(formatstring.format(
colored(pkg, 'red', attrs=('bold', 'underline')),
colored('{}source-package/{}'.format(TRACKER_URL, pkg), 'blue'),
))
for x in sorted(lists[key][pkg], key=lambda x: x.name):
url = '{}{}'.format(TRACKER_URL, x.name)
print(' - {:<16s} {}'.format(x.name, colored(url, 'blue')))
print(' - {:<16s} {} {}'.format(x.name, colored(url, 'blue'), (key == 'unexpected_nodsa' and x.data['releases'][RELEASES['lts']]['nodsa_reason'] or '')))
print('')