Skip to content

Commit

Permalink
Merge pull request #14 from fmarier/display-locations
Browse files Browse the repository at this point in the history
Display location of events in the summary
  • Loading branch information
marvinthepa authored Feb 25, 2022
2 parents f1dc094 + 512de10 commit 02b860c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mutt-ical.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def display(ical):
attendees = ical.vevent.contents['attendee']
else:
attendees = ""
if 'location' in ical.vevent.contents:
locations = ical.vevent.contents['location']
else:
locations = None
sys.stdout.write("From:\t" + sender + "\n")
sys.stdout.write("Title:\t" + summary + "\n")
sys.stdout.write("To:\t")
Expand All @@ -127,6 +131,12 @@ def display(ical):
print("Start:\t%s" % (ical.vevent.dtstart.value.astimezone(tz=None).strftime("%Y-%m-%d %H:%M %z"),))
if hasattr(ical.vevent, 'dtend'):
print("End:\t%s" % (ical.vevent.dtend.value.astimezone(tz=None).strftime("%Y-%m-%d %H:%M %z"),))
if locations:
sys.stdout.write("Location:\t")
for location in locations:
if location.value:
sys.stdout.write(location.value + ", ")
sys.stdout.write("\n")
sys.stdout.write("\n")
sys.stdout.write(description + "\n")

Expand Down

0 comments on commit 02b860c

Please sign in to comment.