Skip to content

Commit

Permalink
Merge pull request #19 from nyuoss/kaining_add_description
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanglin-Tao authored May 12, 2024
2 parents 406a32d + cfa96e6 commit 982d9df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,5 @@ cython_debug/
.vscode/

# ignore config file
# *db_config.py
# *db_config.py
token.json
11 changes: 9 additions & 2 deletions src/open_source_python_template/crawlTasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down

0 comments on commit 982d9df

Please sign in to comment.