summaryrefslogtreecommitdiffstats
path: root/make-directive-index.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-08 02:13:40 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-09 14:47:50 +0100
commit80cb917e6248c15fd4a95d29954b3fd1e3d66b06 (patch)
tree004712066f3d9e1829e4b68acba161269e025d3d /make-directive-index.py
parentbuild-sys: generate links for html alias pages (diff)
downloadsystemd-80cb917e6248c15fd4a95d29954b3fd1e3d66b06.tar.xz
systemd-80cb917e6248c15fd4a95d29954b3fd1e3d66b06.zip
man: use lxml for faster generation and pretty printing
Diffstat (limited to 'make-directive-index.py')
-rwxr-xr-xmake-directive-index.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/make-directive-index.py b/make-directive-index.py
index c61383b0a4..039efaa434 100755
--- a/make-directive-index.py
+++ b/make-directive-index.py
@@ -19,7 +19,12 @@
import sys
import collections
-import xml.etree.ElementTree as tree
+try:
+ from lxml import etree as tree
+ PRETTY = dict(pretty_print=True)
+except ImportError:
+ import xml.etree.ElementTree as tree
+ PRETTY = {}
import re
TEMPLATE = '''\
@@ -277,4 +282,4 @@ def make_page(*xml_files):
return _make_page(template, directive_groups, formatting)
if __name__ == '__main__':
- tree.dump(make_page(*sys.argv[1:]))
+ tree.dump(make_page(*sys.argv[1:]), **PRETTY)