X Tutup
Skip to content

Commit 64eb60b

Browse files
committed
update-dbus-docs: use color in summary
1 parent 7bd5b86 commit 64eb60b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/update-dbus-docs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class NoCommand(Exception):
3131
'org.freedesktop.DBus.Introspectable',
3232
'org.freedesktop.DBus.Properties',
3333
]
34+
RED = '\x1b[31m'
35+
GREEN = '\x1b[32m'
36+
YELLOW = '\x1b[33m'
37+
RESET = '\x1b[39m'
3438

3539
def xml_parser():
3640
return etree.XMLParser(no_network=True,
@@ -327,7 +331,8 @@ def parse_args():
327331
c = classification if info['modified'] else ''
328332
if c:
329333
modified.append(page)
330-
print(f'{p:{mlen + 1}} {t - m}/{t} {c}')
334+
color = RED if m > t/2 else (YELLOW if m else GREEN)
335+
print(f'{color}{p:{mlen + 1}} {t - m}/{t} {c}{RESET}')
331336

332337
if opts.test and modified:
333338
exit(f'Outdated pages: {", ".join(modified)}\n'

0 commit comments

Comments
 (0)
X Tutup