Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion python-release-schedule-ical.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import requests
from ics import Calendar

DEPRECATION = 'DEPRECATED: Use https://peps.python.org/release-schedule.ics instead'

calendar_filename = 'python-releases.ics'

def uid(name):
Expand All @@ -17,8 +19,14 @@ def uid(name):
c = Calendar(r.text)

for event in c.events:
event.description = 'DEPRECATED: Use https://peps.python.org/release-schedule.ics instead'
event.description = DEPRECATION
event.uid = uid(event.name)

for extra in c.extra:
if extra.name == 'X-WR-CALNAME':
extra.value = f'DEPRECATED: {extra.value}'
elif extra.name == 'X-WR-CALDESC':
extra.value = DEPRECATION

with open(calendar_filename, 'w') as write_file:
write_file.write(c.serialize())
4 changes: 2 additions & 2 deletions python-releases.ics
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BEGIN:VCALENDAR
X-WR-CALDESC:Python releases schedule from https://peps.python.org
X-WR-CALNAME:Python releases schedule
X-WR-CALDESC:DEPRECATED: Use https://peps.python.org/release-schedule.ics instead
X-WR-CALNAME:DEPRECATED: Python releases schedule
VERSION:2.0
PRODID:-//Python Software Foundation//Python release schedule//EN
CALSCALE:GEORGIAN
Expand Down