mirror of
https://github.com/nikdoof/NextAction.git
synced 2025-12-13 17:52:17 +00:00
Exit if no API key is defined.
This commit is contained in:
@@ -9,6 +9,7 @@ import time
|
|||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
API_TOKEN = os.environ.get('TODOIST_API_KEY', None)
|
API_TOKEN = os.environ.get('TODOIST_API_KEY', None)
|
||||||
NEXT_ACTION_LABEL = os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action')
|
NEXT_ACTION_LABEL = os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action')
|
||||||
@@ -376,6 +377,9 @@ def DoSyncAndGetUpdated(items_to_sync, sync_state):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
if not API_TOKEN:
|
||||||
|
logging.error('No API key set, exiting...')
|
||||||
|
sys.exit(1)
|
||||||
response = GetResponse()
|
response = GetResponse()
|
||||||
json_data = json.loads(response.read())
|
json_data = json.loads(response.read())
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user