Browse Source

update atom generator for new changelog format

master
Nils 1 year ago
parent
commit
604b648d7f
  1. 14
      atomfeedgen.py

14
atomfeedgen.py

@ -57,11 +57,19 @@ with open(CHANGELOGFILE) as fcl:
changelogData = fcl.read()
for cl in changelogData.split("\n\n"):
for cl in changelogData.split("\n\n\n"):
firstLine, changelog = cl.split("\n", maxsplit=1)
print(firstLine)
date, semVersion = firstLine.split("Version")
if firstLine.startswith("#Changelog"):
#preamble. skip
continue
# Format:## YYYY-MM-DD major.minor.patch
assert "##" in firstLine, firstLine
markdownTitle, date, semVersion = firstLine.split(" ")
assert markdownTitle == "##", markdownTitle
assert date.count("-") == 2, date
assert semVersion.count(".") == 2, semVersion
print(firstLine, "parsed as date:", date, "with version:", semVersion)
semVersion = semVersion.strip()
isodate = datetime.fromisoformat(date.strip())
isodate = isodate.replace(tzinfo=ZoneInfo("UTC"))

Loading…
Cancel
Save