1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

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

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