diff options
author | Tobias Brox <tobias@redpill-linpro.com> | 2019-09-18 11:43:30 +0000 |
---|---|---|
committer | Tobias Brox <tobias@redpill-linpro.com> | 2019-09-18 11:43:30 +0000 |
commit | 420348e74d01e3ca8093c62bc8079cb20b5a3ccb (patch) | |
tree | fc0d1e744988fe4cab635810c58850d058d7fdeb | |
parent | 02642715c88eb10cab16153129d653d546d1a502 (diff) | |
download | calendar-cli-420348e74d01e3ca8093c62bc8079cb20b5a3ccb.zip |
one more python3-fix + a comment
-rwxr-xr-x | calendar-cli.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |