This commit is contained in:
AX10
2024-03-04 22:43:50 +01:00
parent 7421f764e7
commit 303b3b8fce
2 changed files with 13 additions and 0 deletions

12
conflict.py Normal file
View File

@@ -0,0 +1,12 @@
from pathlib import Path
from ical.calendar_stream import IcsCalendarStream
from ical.exceptions import CalendarParseError
filename = Path("./dmz.ics")
with filename.open() as ics_file:
try:
calendar = IcsCalendarStream.calendar_from_ics(ics_file.read())
except CalendarParseError as err:
print(f"Failed to parse ics file '{str(filename)}': {err}")
else:
print([event.summary for event in calendar.timeline])