mirror of https://github.com/Hoffelhas/autodoist
Initial v7 API changes
parent
7a24f83827
commit
52ad1ea908
|
@ -66,7 +66,7 @@ def main():
|
||||||
logging.debug('Connecting to the Todoist API')
|
logging.debug('Connecting to the Todoist API')
|
||||||
api = TodoistAPI(token=args.api_key)
|
api = TodoistAPI(token=args.api_key)
|
||||||
logging.debug('Syncing the current state from the API')
|
logging.debug('Syncing the current state from the API')
|
||||||
api.sync(resource_types=['projects', 'labels', 'items'])
|
api.sync()
|
||||||
|
|
||||||
# Check the next action label exists
|
# Check the next action label exists
|
||||||
labels = api.labels.all(lambda x: x['name'] == args.label)
|
labels = api.labels.all(lambda x: x['name'] == args.label)
|
||||||
|
@ -80,7 +80,7 @@ def main():
|
||||||
def get_project_type(project_object):
|
def get_project_type(project_object):
|
||||||
"""Identifies how a project should be handled."""
|
"""Identifies how a project should be handled."""
|
||||||
name = project_object['name'].strip()
|
name = project_object['name'].strip()
|
||||||
if project['name'] == 'Inbox':
|
if name == 'Inbox':
|
||||||
return args.inbox
|
return args.inbox
|
||||||
elif name[-1] == args.parallel_suffix:
|
elif name[-1] == args.parallel_suffix:
|
||||||
return 'parallel'
|
return 'parallel'
|
||||||
|
@ -112,7 +112,7 @@ def main():
|
||||||
# Main loop
|
# Main loop
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
api.sync(resource_types=['projects', 'labels', 'items'])
|
api.sync()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception('Error trying to sync with Todoist API: %s' % str(e))
|
logging.exception('Error trying to sync with Todoist API: %s' % str(e))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
todoist-python==0.2.26
|
todoist-python>=7.0.10,<8.0.0
|
Loading…
Reference in New Issue