diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lmu_ical.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/lmu_ical.py b/scripts/lmu_ical.py new file mode 100755 index 0000000..c096524 --- /dev/null +++ b/scripts/lmu_ical.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import icalendar +import sys + +# Fix LMU LSF iCal files +# first arg is original file + +e = open(sys.argv[1], 'rb') +cal = icalendar.Calendar.from_ical(e.read()) +e.close() + +for component in cal.walk(): + if component.name == "VEVENT": + if 'exdate' in component and component['exdate'] is None: + del component['exdate'] + +f = open('fixed.ics', 'wb') +f.write(cal.to_ical()) +f.close() |