chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fileio: in envfiles, do not skip lines following empty lines
[elogind.git]
/
make-directive-index.py
diff --git
a/make-directive-index.py
b/make-directive-index.py
index c61383b0a46482e46f3e94c2f956d01b7fea607f..99e7bfaf2856e1500796d7af913ff615d63292e3 100755
(executable)
--- a/
make-directive-index.py
+++ b/
make-directive-index.py
@@
-19,8
+19,8
@@
import sys
import collections
import sys
import collections
-import xml.etree.ElementTree as tree
import re
import re
+from xml_helper import *
TEMPLATE = '''\
<refentry id="systemd.directives" conditional="HAVE_PYTHON">
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):
'''
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
section = t.find('./refmeta/manvolnum').text
pagename = t.find('./refmeta/refentrytitle').text
@@
-277,4
+277,5
@@
def make_page(*xml_files):
return _make_page(template, directive_groups, formatting)
if __name__ == '__main__':
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:])))