From ac1eda3476371edd3b84c8498d63a7b2a281823c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 27 Dec 2022 15:23:41 +0100 Subject: [PATCH] extract-metadata.py: Add tag info to xeplist.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- tools/extract-metadata.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/extract-metadata.py b/tools/extract-metadata.py index cf0ecbda..68ab67fa 100755 --- a/tools/extract-metadata.py +++ b/tools/extract-metadata.py @@ -101,6 +101,12 @@ def extract_xep_metadata(document): else: last_call = None + tags = [] + tags_elem = minidom_find_child(header, "tags") + if tags_elem is not None: + for child in minidom_children(tags_elem): + tags.append(minidom_get_text(child)) + return { "last_revision": { "version": last_revision_version, @@ -113,6 +119,7 @@ def extract_xep_metadata(document): "sig": sig, "abstract": abstract, "shortname": shortname, + "tags": tags, "title": title, "approver": approver, "last_call": last_call, @@ -137,6 +144,12 @@ def make_metadata_element(number, metadata, accepted, *, protoname=None): if metadata["shortname"] is not None: result.append(text_element("shortname", metadata["shortname"])) + if metadata["tags"]: + tags = etree.Element("tags") + for tag in metadata["tags"]: + tags.append(text_element("tag", tag)) + result.append(tags) + if metadata["last_revision"]["version"] is not None: last_revision = metadata["last_revision"] revision_el = etree.Element("last-revision")