-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display Google Tasks #585
base: main
Are you sure you want to change the base?
Display Google Tasks #585
Conversation
It seems like I can't mark the pull request as a draft |
I get the following when trying to request the Tasks API (while authenticated): HttpError 403 when requesting https://tasks.googleapis.com/tasks/v1/users/@me/lists?alt=json returned "Tasks API has not been used in project 905806700719 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tasks.googleapis.com/overview?project=905806700719 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.". Details: "Tasks API has not been used in project 905806700719 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tasks.googleapis.com/overview?project=905806700719 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry." @insanum, you might want to enable tasks v1 in your API Console |
I can start developing without it, but it'll be more difficult. I'll start anyways |
I enabled the Tasks API to the gcalcli Google project. Let me know if you run into issues. |
Ah, it still says that it's not enabled. I tried deleting Here's the stdout just in case: /home/ewen/.cache/pypoetry/virtualenvs/gcalcli-xBV0FQLW-py3.9/lib/python3.9/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/ewen/.gcalcli_oauth: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Ouverture dans une session de navigateur existante.
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/v2/auth?client_id=905806700719-t5vnoihjo24n4jogi0p64mdijm5h181c.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ftasks&access_type=offline&response_type=code
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
--noauth_local_webserver
Authentication successful.
Traceback (most recent call last):
File "/home/ewen/.cache/pypoetry/virtualenvs/gcalcli-xBV0FQLW-py3.9/bin/gcalcli", line 5, in <module>
main()
File "/home/ewen/projects/gcalcli/gcalcli/cli.py", line 152, in main
gcal.AgendaQuery(start=parsed_args.start, end=parsed_args.end)
File "/home/ewen/projects/gcalcli/gcalcli/gcal.py", line 1267, in AgendaQuery
return self._display_queried_events(start, end)
File "/home/ewen/projects/gcalcli/gcalcli/gcal.py", line 1212, in _display_queried_events
tasks_list = self._search_for_tasks(start, end, search)
File "/home/ewen/projects/gcalcli/gcalcli/gcal.py", line 1171, in _search_for_tasks
for tasklist in self.tasks_service.tasklists().list().execute():
File "/home/ewen/.cache/pypoetry/virtualenvs/gcalcli-xBV0FQLW-py3.9/lib/python3.9/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/ewen/.cache/pypoetry/virtualenvs/gcalcli-xBV0FQLW-py3.9/lib/python3.9/site-packages/googleapiclient/http.py", line 915, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://tasks.googleapis.com/tasks/v1/users/@me/lists?alt=json returned "Tasks API has not been used in project 905806700719 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tasks.googleapis.com/overview?project=905806700719 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.". Details: "Tasks API has not been used in project 905806700719 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tasks.googleapis.com/overview?project=905806700719 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."> |
I'm not going to claim to understand the whole Google Cloud API management as it's presented today (vs when gcalcli was started many years ago). :-) Here is what I see on the console. One thing I noticed in your error message is the project number 9058xxx... isn't the same project number. Did you create your own project for calendar API access? |
hm... All I did was add a service via self.tasks_service = build(
serviceName="tasks", version="v1", http=self._google_auth()
) using Maybe I shouldn't be calling |
Still no success, it gives the same error message and refers to project |
Even weirder, the web auth flow still displays gcalcli as the application name, as if it was the correct project |
It seems like it indeed created a new 'gcalcli' project on my own google account automatically (which bizarre in and of itself) without me changing anything in the |
So i'm not too sure about how to integrate it into the gigantic I didn't have much time lastly to work on this PR, but I'm motivated to get it done by May |
I don't have an opinion one way or the other. Only thing I suggest is do whatever feels right and makes the most sense. |
@michaelmhoffman I saw your PR w/ the huge refactoring of EDIT: To clarify, would adding a |
Out of curiosity, how close are you to getting this completed? |
@rudrrayan still waiting for @michaelmhoffman to answer my question. I don't really want to mess up the project's architecture, since it's quite large. |
@ewen-lbh I'm not familiar with the Google Tasks API (or even Tasks as an end-user at all) unfortunately. Skimming the API it does not seem like there is a lot of overlap between the fields of an event and a task. The general pattern might be useful for you. Will discuss that below. Would it make sense to have a separate entry points for working with tasks? I don't use tasks myself but feel they are rather orthogonal to calendar events and am not sure I would want
Doing this will also keep the tasks code relatively self-contained which will make it easier for people to edit it without stepping on the toes of people working on events and vice versa. And if that's the case I don't think many will care much how you implement it. If you would like to use something like |
Hey there, just checking in to mention I'm available now as a maintainer to review this if you still want to get it finished up and merged. =) About the APIs, the good news / bad news is that there's no longer a centralized Google Cloud project ID for this, so everyone needs to configure the project settings for themselves but they have full control over the options... |
One concern is that already-logged-in users will have to clear their auth cache and re-auth when upgrading, or else it'll fail with permission errors while trying to access
self.tasks_service
Closes #337
Closes #558
Closes #221
Note: this PR does not attempt to provide full Tasks integration (ie the ability to add or edit tasks), only the displaying of it.
I may attempt this in another PR though.