1
0
mirror of https://github.com/systemd/systemd synced 2025-09-30 09:14:46 +02:00

Compare commits

..

No commits in common. "2a8e00846f37883f2a93941fe376476ec83784fe" and "900915080a0c8da0236ceb322a679e19db139100" have entirely different histories.

View File

@ -31,10 +31,6 @@ 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,
@ -293,7 +289,7 @@ def process(page):
with open(page, 'w') as out:
out.write(out_text)
return dict(stats=stats, modified=(out_text != src))
return dict(stats=stats, outdated=(out_text != src))
def parse_args():
p = argparse.ArgumentParser()
@ -321,19 +317,17 @@ if __name__ == '__main__':
# Let's print all statistics at the end
mlen = max(len(page) for page in stats)
total = sum((item['stats'] for item in stats.values()), collections.Counter())
total = 'total', dict(stats=total, modified=False)
modified = []
classification = 'OUTDATED' if opts.test else 'MODIFIED'
total = 'total', dict(stats=total, outdated=False)
outdated = []
for page, info in sorted(stats.items()) + [total]:
m = info['stats']['missing']
t = info['stats']['total']
p = page + ':'
c = classification if info['modified'] else ''
c = 'OUTDATED' if info['outdated'] else ''
if c:
modified.append(page)
color = RED if m > t/2 else (YELLOW if m else GREEN)
print(f'{color}{p:{mlen + 1}} {t - m}/{t} {c}{RESET}')
outdated.append(page)
print(f'{p:{mlen + 1}} {t - m}/{t} {c}')
if opts.test and modified:
exit(f'Outdated pages: {", ".join(modified)}\n'
if opts.test and outdated:
exit(f'Outdated pages: {", ".join(outdated)}\n'
f'Hint: ninja -C {opts.build_dir} update-dbus-docs')