diff --git a/.gitignore b/.gitignore index 7bde522..da39e28 100644 --- a/.gitignore +++ b/.gitignore @@ -169,4 +169,5 @@ cython_debug/ .vscode/ # ignore config file -# *db_config.py \ No newline at end of file +# *db_config.py +token.json diff --git a/src/open_source_python_template/crawlTasks.py b/src/open_source_python_template/crawlTasks.py index 139f0de..abaebea 100644 --- a/src/open_source_python_template/crawlTasks.py +++ b/src/open_source_python_template/crawlTasks.py @@ -18,7 +18,9 @@ def get_tasks(): if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: - flow = InstalledAppFlow.from_client_secrets_file("credential.json", SCOPES) + flow = InstalledAppFlow.from_client_secrets_file( + "src/open_source_python_template/credential.json", SCOPES + ) creds = flow.run_local_server(port=0) with open("token.json", "w") as token: token.write(creds.to_json()) @@ -38,10 +40,15 @@ def get_tasks(): for task in tasks_items: tasks_response.append( { - "title": task["title"], + "title": task["title"] if "title" in task else "No title", "id": task["id"], "tasklist_id": tasklist["id"], "tasklist_title": tasklist["title"], + "taskdescription": ( + task["notes"] + if "notes" in task + else "No description available" + ), } ) return tasks_response