diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-07-17 22:39:37 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-08-10 18:13:29 +0200 |
commit | 234909f9d6833ae619cb4c10a146ddeb4abb4e86 (patch) | |
tree | c048880124bed4ffadb984de5ddef80a69358c45 /tools/update-man-rules.py | |
parent | tools: pylint update-dbus-docs.py (diff) | |
download | systemd-234909f9d6833ae619cb4c10a146ddeb4abb4e86.tar.xz systemd-234909f9d6833ae619cb4c10a146ddeb4abb4e86.zip |
tools: pylint update-man-rules.py
Diffstat (limited to 'tools/update-man-rules.py')
-rwxr-xr-x | tools/update-man-rules.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/update-man-rules.py b/tools/update-man-rules.py index 3a8c31dc35..1c2c9a8f65 100755 --- a/tools/update-man-rules.py +++ b/tools/update-man-rules.py @@ -1,16 +1,17 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later -from __future__ import print_function import collections import glob +import pprint import sys from pathlib import Path -import pprint + from xml_helper import xml_parse + def man(page, number): - return '{}.{}'.format(page, number) + return f'{page}.{number}' def add_rules(rules, name): xml = xml_parse(name) @@ -60,7 +61,7 @@ MESON_FOOTER = '''\ # Really, do not edit. ''' -def make_mesonfile(rules, dist_files): +def make_mesonfile(rules, _dist_files): # reformat rules as # grouped = [ [name, section, [alias...], condition], ...] # @@ -77,7 +78,7 @@ def make_mesonfile(rules, dist_files): for p, aliases in sorted(grouped.items()) ] return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER)) -if __name__ == '__main__': +def main(): source_glob = sys.argv[1] target = Path(sys.argv[2]) @@ -95,3 +96,6 @@ if __name__ == '__main__': tmp = target.with_suffix('.tmp') tmp.write_text(text) tmp.rename(target) + +if __name__ == '__main__': + main() |