diff options
author | Tobias Brox <t@tobixen.no> | 2015-05-17 15:49:03 +0200 |
---|---|---|
committer | Tobias Brox <t@tobixen.no> | 2015-05-17 15:49:03 +0200 |
commit | 6beb86ba9b3349ef244e0c50bcf1e84cd6cc2268 (patch) | |
tree | f78a7dc187809834629da80b4b7e26b5b0bd6e45 | |
parent | 383d1ceea422302b23dbce713b1053276dccb6df (diff) | |
download | calendar-cli-6beb86ba9b3349ef244e0c50bcf1e84cd6cc2268.zip |
work in progress ...
-rwxr-xr-x | calendar-cli.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/calendar-cli.py b/calendar-cli.py index dac5ddc..f9c866d 100755 --- a/calendar-cli.py +++ b/calendar-cli.py @@ -8,6 +8,7 @@ import tzlocal import time from datetime import datetime, timedelta, date import dateutil.parser +from dateutil.rrule import rrulestr from icalendar import Calendar,Event,Todo,Journal import caldav import uuid @@ -521,7 +522,21 @@ def todo_complete(caldav_conn, args): raise ValueError("No caldav connection, aborting") tasks = todo_select(caldav_conn, args) for task in tasks: + if hasattr(task.instance.vtodo, 'rrule'): + rrule = rrulestr(task.instance.vtodo.rrule.value) + try: + next = rrule.after(datetime.now()) + except TypeError: ## pesky problem with comparition of timestamps with and without tzinfo + next = rrule.after(datetime.now(tz=tzlocal.get_localzone())) + import pdb; pdb.set_trace() + ## WORK IN PROGRESS + ## task.rrule.count - decrease it? + ## new_task should be a copy of task + ## set new_task.rrule_id or whatnot + ## delete new_task.rrule + ## new_task should be completed, old task should not. task.complete() + def todo_delete(caldav_conn, args): if args.nocaldav: |