From: Samir Benmendil Date: Mon, 2 Aug 2021 14:42:09 +0000 (+0100) Subject: mutt: support ical events with a single attendee X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/2cfde17d621fd012c2d352e2b23f095cbd628eff mutt: support ical events with a single attendee --- diff --git a/mutt/ical2txt b/mutt/ical2txt index f5d2a9e..b8e50a2 100755 --- a/mutt/ical2txt +++ b/mutt/ical2txt @@ -9,7 +9,10 @@ def format_cal(event): str += "End: {:%Y-%m-%d %H:%M}\n".format(end.astimezone()) if event.get('attendee') is not None: - attendees = [ a.params['cn'] for a in event.get('attendee') ] + att = event.get('attendee') + if not isinstance(att, list): + att = [att] + attendees = [ a.params['cn'] for a in att] str += "Attendees:\n" for a in attendees: str += "\t{}\n".format(a)