summaryrefslogtreecommitdiff
path: root/calendar-cli.py
diff options
context:
space:
mode:
authorTobias Brox <t@tobixen.no>2015-05-17 15:49:03 +0200
committerTobias Brox <t@tobixen.no>2015-05-17 15:49:03 +0200
commit6beb86ba9b3349ef244e0c50bcf1e84cd6cc2268 (patch)
treef78a7dc187809834629da80b4b7e26b5b0bd6e45 /calendar-cli.py
parent383d1ceea422302b23dbce713b1053276dccb6df (diff)
downloadcalendar-cli-6beb86ba9b3349ef244e0c50bcf1e84cd6cc2268.zip
work in progress ...
Diffstat (limited to 'calendar-cli.py')
-rwxr-xr-xcalendar-cli.py15
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: