mirror of https://github.com/Hoffelhas/autodoist
Final preparations for v2.0
parent
2ce81df5bd
commit
8a1bc1d5ec
10
autodoist.py
10
autodoist.py
|
@ -362,14 +362,20 @@ def initialise_api(args):
|
||||||
|
|
||||||
# Run the initial sync
|
# Run the initial sync
|
||||||
logging.debug('Connecting to the Todoist API')
|
logging.debug('Connecting to the Todoist API')
|
||||||
|
try:
|
||||||
api_arguments = {'token': args.api_key}
|
api_arguments = {'token': args.api_key}
|
||||||
api = TodoistAPI(**api_arguments)
|
api = TodoistAPI(**api_arguments)
|
||||||
logging.info("Autodoist has successfully connected to Todoist!")
|
|
||||||
|
|
||||||
sync_api = initialise_sync_api(api)
|
sync_api = initialise_sync_api(api)
|
||||||
# Save SYNC API token to enable partial syncs
|
# Save SYNC API token to enable partial syncs
|
||||||
api.sync_token = sync_api['sync_token']
|
api.sync_token = sync_api['sync_token']
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(
|
||||||
|
f"Could not connect to Todoist: '{e}'")
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
logging.info("Autodoist has successfully connected to Todoist!")
|
||||||
|
|
||||||
# Check if labels exist
|
# Check if labels exist
|
||||||
|
|
||||||
# If labeling argument is used
|
# If labeling argument is used
|
||||||
|
|
Loading…
Reference in New Issue