Переглянути джерело

added function that opens all tasks without notes

master
Wouter Horlings 6 роки тому
джерело
коміт
a0de3c9df2
2 змінених файлів з 10 додано та 0 видалено
  1. +9
    -0
      myTodoist.py
  2. +1
    -0
      taskcheck.py

+ 9
- 0
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)


+ 1
- 0
taskcheck.py Переглянути файл

@@ -12,6 +12,7 @@ def main():
todoist.checktaskstoday(3)
todoist.checkTasksWithoutNotes()
todoist.checkTasksOverDue()
todoist.openTasksWithoutNotes()





Завантаження…
Відмінити
Зберегти