extract-metadata.py: Add tag info to xeplist.xml

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-12-27 15:23:41 +01:00
parent e4fdc477b7
commit ac1eda3476
No known key found for this signature in database
GPG Key ID: DEDA74AEECA9D0F2
1 changed files with 13 additions and 0 deletions

View File

@ -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")