archive
/
actioner
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
actioner/actioner/utils/todoist.py

20 lines
410 B
Python

from todoist.models import Item
def is_task_completed(task: Item):
"""
`Item` doesn't support `.get`, so re-implement it
"""
try:
return task["checked"]
except KeyError:
return False
def get_existing_tasks(project_id, todoist):
return {
item["id"]: item["content"]
for item in todoist.state["items"]
if item["project_id"] == project_id
}