chiark / gitweb /
journald: Do not always record _AUDIT_SESSION and _AUDIT_LOGINUID
[elogind.git] / make-directive-index.py
index 15bd9b93410334c6982792939d4777aec6fdaa81..99e7bfaf2856e1500796d7af913ff615d63292e3 100755 (executable)
@@ -19,8 +19,8 @@
 
 import sys
 import collections
-import xml.etree.ElementTree as tree
 import re
+from xml_helper import *
 
 TEMPLATE = '''\
 <refentry id="systemd.directives" conditional="HAVE_PYTHON">
@@ -168,7 +168,7 @@ referring to {pages} individual manual pages.
 '''
 
 def _extract_directives(directive_groups, formatting, page):
-    t = tree.parse(page)
+    t = xml_parse(page)
     section = t.find('./refmeta/manvolnum').text
     pagename = t.find('./refmeta/refentrytitle').text
 
@@ -185,7 +185,10 @@ def _extract_directives(directive_groups, formatting, page):
                 stor[text].append((pagename, section))
                 if text not in formatting:
                     # use element as formatted display
-                    name.tail = ''
+                    if name.text[-1] in '= ':
+                        name.clear()
+                    else:
+                        name.tail = ''
                     name.text = text
                     formatting[text] = name
 
@@ -274,4 +277,5 @@ def make_page(*xml_files):
     return _make_page(template, directive_groups, formatting)
 
 if __name__ == '__main__':
-    tree.dump(make_page(*sys.argv[1:]))
+    with open(sys.argv[1], 'wb') as f:
+        f.write(xml_print(make_page(*sys.argv[2:])))