Final preparations for v2.0

dev^2
Hoffelhas 2023-01-15 21:55:30 +01:00
parent 2ce81df5bd
commit 8a1bc1d5ec
1 changed files with 12 additions and 6 deletions

View File

@ -362,13 +362,19 @@ 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')
api_arguments = {'token': args.api_key} try:
api = TodoistAPI(**api_arguments) api_arguments = {'token': args.api_key}
logging.info("Autodoist has successfully connected to Todoist!") api = TodoistAPI(**api_arguments)
sync_api = initialise_sync_api(api)
# Save SYNC API token to enable partial syncs
api.sync_token = sync_api['sync_token']
except Exception as e:
logging.error(
f"Could not connect to Todoist: '{e}'")
exit(0)
sync_api = initialise_sync_api(api) logging.info("Autodoist has successfully connected to Todoist!")
# Save SYNC API token to enable partial syncs
api.sync_token = sync_api['sync_token']
# Check if labels exist # Check if labels exist