Browse Source

update atom generator for new changelog format

master
Nils 2 months ago
parent
commit
604b648d7f
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      atomfeedgen.py

+ 11
- 3
atomfeedgen.py View File

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