From 80cb917e6248c15fd4a95d29954b3fd1e3d66b06 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 7 Mar 2013 20:13:40 -0500 Subject: man: use lxml for faster generation and pretty printing --- make-man-index.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'make-man-index.py') diff --git a/make-man-index.py b/make-man-index.py index d38d5b63f..d9ab5cc75 100755 --- a/make-man-index.py +++ b/make-man-index.py @@ -19,7 +19,12 @@ # along with systemd; If not, see . 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 sys import re MDASH = ' — ' if sys.version_info.major >= 3 else ' -- ' @@ -130,4 +135,4 @@ def make_page(xml_files): return template if __name__ == '__main__': - tree.dump(make_page(sys.argv[1:])) + tree.dump(make_page(sys.argv[1:]), **PRETTY) -- cgit v1.2.3-65-gdbad