diff options
-rwxr-xr-x | filters/show-ics-details.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/filters/show-ics-details.py b/filters/show-ics-details.py index bb3ad3d8..18b2b760 100755 --- a/filters/show-ics-details.py +++ b/filters/show-ics-details.py @@ -41,22 +41,22 @@ def extract_field(cal: vobject.icalendar.VCalendar2_0, name: str) -> str: name -- The field name. """ try: - match name.strip(): - case 'attendees': - attendees = [] - for attendee in cal.vevent.attendee_list: - attendees.append(remove_mailto(attendee.valueRepr()).strip()) - return ', '.join(attendees) - case 'description': - return cal.vevent.description.valueRepr().strip() - case 'dtstart': - return str(cal.vevent.dtstart.valueRepr()).strip() - case 'organizer': - return remove_mailto(cal.vevent.organizer.valueRepr()).strip() - case 'summary': - return cal.vevent.summary.valueRepr().strip() - case _: - return '' + name = name.strip() + if name == 'attendees': + attendees = [] + for attendee in cal.vevent.attendee_list: + attendees.append(remove_mailto(attendee.valueRepr()).strip()) + return ', '.join(attendees) + elif name == 'description': + return cal.vevent.description.valueRepr().strip() + elif name == 'dtstart': + return str(cal.vevent.dtstart.valueRepr()).strip() + elif name == 'organizer': + return remove_mailto(cal.vevent.organizer.valueRepr()).strip() + elif name == 'summary': + return cal.vevent.summary.valueRepr().strip() + else: + return '' except AttributeError: return '' |