Skip to content

Commit

Permalink
tools: Add '<supersedes>' and '<supersededby>' elements to xeplist.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
cal0pteryx authored and iNPUTmice committed Jan 17, 2025
1 parent bec301a commit 475b373
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/extract-metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ def extract_xep_metadata(document):
for child in minidom_children(tags_elem):
tags.append(minidom_get_text(child))

supersedes = []
supersedes_el = minidom_find_child(header, "supersedes")
if supersedes_el is not None:
for child in minidom_children(supersedes_el):
supersedes.append(minidom_get_text(child))

supersededby = []
supersededby_el = minidom_find_child(header, "supersededby")
if supersededby_el is not None:
for child in minidom_children(supersededby_el):
supersededby.append(minidom_get_text(child))

return {
"last_revision": {
"version": last_revision_version,
Expand All @@ -120,6 +132,8 @@ def extract_xep_metadata(document):
"abstract": abstract,
"shortname": shortname,
"tags": tags,
"supersedes": supersedes,
"supersededby": supersededby,
"title": title,
"approver": approver,
"last_call": last_call,
Expand Down Expand Up @@ -150,6 +164,18 @@ def make_metadata_element(number, metadata, accepted, *, protoname=None):
tags.append(text_element("tag", tag))
result.append(tags)

if metadata["supersedes"]:
supersedes = etree.Element("supersedes")
for spec in metadata["supersedes"]:
supersedes.append(text_element("spec", spec))
result.append(supersedes)

if metadata["supersededby"]:
supersededby = etree.Element("supersededby")
for spec in metadata["supersededby"]:
supersededby.append(text_element("spec", spec))
result.append(supersededby)

if metadata["last_revision"]["version"] is not None:
last_revision = metadata["last_revision"]
revision_el = etree.Element("last-revision")
Expand Down

0 comments on commit 475b373

Please sign in to comment.