From 420348e74d01e3ca8093c62bc8079cb20b5a3ccb Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Wed, 18 Sep 2019 11:43:30 +0000 Subject: one more python3-fix + a comment --- calendar-cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calendar-cli.py b/calendar-cli.py index 6955704..b9e5aaf 100755 --- a/calendar-cli.py +++ b/calendar-cli.py @@ -474,6 +474,7 @@ def calendar_agenda(caldav_conn, args): dtend = dtstart + timedelta(minutes=args.agenda_mins) elif args.agenda_days: dtend = dtstart + timedelta(args.agenda_days) + ## TODO - error handling if dtend is not set above - but agenda_days have a default value, so that probably won't happen ## TODO: time zone events_ = find_calendar(caldav_conn, args).date_search(dtstart, dtend, expand=True) @@ -499,7 +500,7 @@ def calendar_agenda(caldav_conn, args): if not dtstart.tzinfo: dtstart = _tz(args).localize(dtstart) events.append({'dtstart': dtstart, 'instance': event}) - events.sort(lambda a,b: cmp(a['dtstart'], b['dtstart'])) + events.sort(key=lambda a: a['dtstart']) for event in events: event['summary'] = "(no description)" event['dtstart'] = event['dtstart'].strftime(args.timestamp_format) -- cgit v1.2.3