diff --git a/myTodoist.py b/myTodoist.py index fefca02..e1fa57a 100644 --- a/myTodoist.py +++ b/myTodoist.py @@ -49,6 +49,8 @@ class TodoProject: self.project == None self.items = TodoItemList(None,self.api) +##@brief synchronize data from Todoist with the api object. +# @return response of server def sync(self): return self.api.sync() @@ -67,6 +69,13 @@ class TodoProject: self.sendnotification("TASKS","There is one task over due!") elif _overdueItems>1: self.sendnotification("TASKS","There are " + str(_overdueItems) + " tasks over due!") + + def openTasksWithoutNotes(self): + for item in self.items.itemsClosedWithoutNotes(): + item_handle = item.api.items.get_by_id(item.id) + item_handle.uncomplete() + self.api.commit() + def sendnotification(self,title,body): Application = Gio.Application.new("todoist.tasks", Gio.ApplicationFlags.FLAGS_NONE) diff --git a/taskcheck.py b/taskcheck.py index a1c6a21..be028cb 100644 --- a/taskcheck.py +++ b/taskcheck.py @@ -12,6 +12,7 @@ def main(): todoist.checktaskstoday(3) todoist.checkTasksWithoutNotes() todoist.checkTasksOverDue() + todoist.openTasksWithoutNotes()