From 6871890f9e5778619c8d76117655dd075c1b7b78 Mon Sep 17 00:00:00 2001 From: Thomas Lundström Date: Wed, 8 Jun 2016 17:18:05 +0200 Subject: Updated release info --- doc/gen_pkgdiff.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'doc/gen_pkgdiff.py') diff --git a/doc/gen_pkgdiff.py b/doc/gen_pkgdiff.py index acfbadc..7dd8c73 100644 --- a/doc/gen_pkgdiff.py +++ b/doc/gen_pkgdiff.py @@ -12,7 +12,8 @@ # # Note that packages with the unchanged version is not listed. # -# The output is presented as XML code printed to stdout. +# The output is presented as XML code printed to stdout. A summary is printed +# to STDERR at the end. # ############################################################################### @@ -22,11 +23,18 @@ import xml.etree.ElementTree as ET def get_pkgs(file_spec): if file_spec.find(":") >= 0: - cmd = ("git", "show", file_spec) - root = ET.fromstring(subprocess.check_output(cmd)) - + s = subprocess.check_output(("git", "show", file_spec)) else: - root = ET.parse(file_spec) + f = open(file_spec) + s = f.read() + f.close() + del f + + # ET can't handle some special quotes + for old, new in (("”", """), ("”", """)): + s = s.replace(old, new) + + root = ET.fromstring(s) for node in root.iter("section"): if "id" in node.attrib: -- cgit v1.2.3-54-g00ecf