Skip to content

Commit 0b5d69e

Browse files
committed
Add deprecation notices to the calendar name and description
Related to #72
1 parent 81effc9 commit 0b5d69e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

python-release-schedule-ical.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import requests
55
from ics import Calendar
66

7+
DEPRECATION = 'DEPRECATED: Use https://peps.python.org/release-schedule.ics instead'
8+
79
calendar_filename = 'python-releases.ics'
810

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

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

25+
for extra in c.extra:
26+
if extra.name == 'X-WR-CALNAME':
27+
extra.value = f'DEPRECATED: {extra.value}'
28+
elif extra.name == 'X-WR-CALDESC':
29+
extra.value = DEPRECATION
30+
2331
with open(calendar_filename, 'w') as write_file:
2432
write_file.write(c.serialize())

python-releases.ics

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BEGIN:VCALENDAR
2-
X-WR-CALDESC:Python releases schedule from https://peps.python.org
3-
X-WR-CALNAME:Python releases schedule
2+
X-WR-CALDESC:DEPRECATED: Use https://peps.python.org/release-schedule.ics instead
3+
X-WR-CALNAME:DEPRECATED: Python releases schedule
44
VERSION:2.0
55
PRODID:-//Python Software Foundation//Python release schedule//EN
66
CALSCALE:GEORGIAN

0 commit comments

Comments
 (0)