]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
make-man-index: apply "ruff format"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 19 Feb 2026 17:11:19 +0000 (02:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:44:47 +0000 (02:44 +0900)
tools/make-man-index.py

index b4b262b508daf5ab110a542ac8c0a26c6193c984..f4c0fe89448c779bfcf2698544319dbda4138e07 100755 (executable)
@@ -49,6 +49,7 @@ def check_id(page, t):
     if not re.search('/' + page_id + '[.]', page.translate(str.maketrans('@', '_'))):
         raise ValueError(f"id='{page_id}' is not the same as page name '{page}'")
 
+
 def make_index(pages):
     index = collections.defaultdict(list)
     for p in pages:
@@ -63,6 +64,7 @@ def make_index(pages):
             index[f.text[0].upper()].append(infos)
     return index
 
+
 def add_letter(template, letter, pages):
     refsect1 = tree.SubElement(template, 'refsect1')
     title = tree.SubElement(refsect1, 'title')
@@ -77,10 +79,11 @@ def add_letter(template, letter, pages):
         d = tree.SubElement(b, 'manvolnum')
         d.text = section
 
-        b.tail = MDASH + purpose # + ' (' + p + ')'
+        b.tail = MDASH + purpose  # + ' (' + p + ')'
 
         tree.SubElement(para, 'sbr')
 
+
 def add_summary(template, indexpages):
     count = 0
     pages = set()
@@ -96,6 +99,7 @@ def add_summary(template, indexpages):
     para = template.find(".//para[@id='counts']")
     para.text = COUNTS.format(count=count, pages=len(pages))
 
+
 def make_page(*xml_files):
     template = tree.fromstring(TEMPLATE)
     index = make_index(xml_files)
@@ -107,6 +111,7 @@ def make_page(*xml_files):
 
     return template
 
+
 if __name__ == '__main__':
     with open(sys.argv[1], 'wb') as file:
         file.write(xml_print(make_page(*sys.argv[2:])))