summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-06 10:02:37 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-06 11:41:42 +0100
commit64eb60b8c5ee5ec97fcd53dc5ab176ca575cf30e (patch)
tree4c37169dda624b214f8a6f95693a2ad46cbd141b /tools
parent7bd5b8614d2bb5602c52af05b637d712fbc0682d (diff)
downloadsystemd-64eb60b8c5ee5ec97fcd53dc5ab176ca575cf30e.tar.gz
update-dbus-docs: use color in summary
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update-dbus-docs.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/update-dbus-docs.py b/tools/update-dbus-docs.py
index 562bfcf1c1..397d131be8 100755
--- a/tools/update-dbus-docs.py
+++ b/tools/update-dbus-docs.py
@@ -31,6 +31,10 @@ BORING_INTERFACES = [
'org.freedesktop.DBus.Introspectable',
'org.freedesktop.DBus.Properties',
]
+RED = '\x1b[31m'
+GREEN = '\x1b[32m'
+YELLOW = '\x1b[33m'
+RESET = '\x1b[39m'
def xml_parser():
return etree.XMLParser(no_network=True,
@@ -327,7 +331,8 @@ if __name__ == '__main__':
c = classification if info['modified'] else ''
if c:
modified.append(page)
- print(f'{p:{mlen + 1}} {t - m}/{t} {c}')
+ color = RED if m > t/2 else (YELLOW if m else GREEN)
+ print(f'{color}{p:{mlen + 1}} {t - m}/{t} {c}{RESET}')
if opts.test and modified:
exit(f'Outdated pages: {", ".join(modified)}\n'