summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSylvain Beucler <beuc@beuc.net>2019-07-02 11:08:20 +0200
committerSylvain Beucler <beuc@beuc.net>2019-07-02 11:12:08 +0200
commitd9e8c731999bb4306696b76439c2a420d84b5254 (patch)
treee243eec0c14d6810153af923eabfe6d8fb7ab2b2 /bin
parentb8b0b9b344842ecb1fb1bae97541c923ef1ae15f (diff)
lts-cve-triage: fix formatting with no-colors output
Diffstat (limited to 'bin')
-rwxr-xr-xbin/lts-cve-triage.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/lts-cve-triage.py b/bin/lts-cve-triage.py
index 5562ce49fe..911ae32c0c 100755
--- a/bin/lts-cve-triage.py
+++ b/bin/lts-cve-triage.py
@@ -24,10 +24,12 @@ 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
@@ -150,7 +152,10 @@ 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'),
))

© 2014-2024 Faster IT GmbH | imprint | privacy policy