首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使GoogleCalendarScreenlet显示谷歌日历?

如何使GoogleCalendarScreenlet显示谷歌日历?
EN

Ask Ubuntu用户
提问于 2019-05-15 15:06:15
回答 1查看 664关注 0票数 0

我正在运行Ubuntu 16.04.6已安装。

我向它添加了ppa:screenlets/ppa并安装了screenlets-pack-all包。

然后我启动了screenlets管理器,并将GoogleCalendarScreenlet 0.4.16++添加到我的桌面上。

已经在选项gCal→→Google帐户中设置了凭据。

它显示登录成功的通知:

但是它没有显示我的日历中的事件。

为什么?是只有我吗,还是根本不起作用?

是否存在工作桌面(小部件)?

一些日志如下:

代码语言:javascript
复制
$ screenlets

/usr/lib/python2.7/dist-packages/screenlets/backend.py:166: Warning: Source ID 2251 was not found when attempting to remove it
  gobject.source_remove(self.__timeout)
Traceback (most recent call last):
  File "/usr/share/screenlets/screenlets-pack-all/GoogleCalendar/GoogleCalendarScreenlet.py", line 133, in __deal_with_data
    all_calendars_feed = self.screenlet.cal_client.GetAllCalendarsFeed()
  File "/usr/lib/python2.7/dist-packages/gdata/calendar/service.py", line 81, in GetAllCalendarsFeed
    return self.Get(uri, converter=gdata.calendar.CalendarListFeedFromString)
  File "/usr/lib/python2.7/dist-packages/gdata/service.py", line 1107, in Get
    'reason': server_response.reason, 'body': result_body}
RequestError: {'status': 403, 'body': '\n\nForbidden\n\n\nForbidden\nError 403\n\n\n', 'reason': 'Forbidden'}

$ tail -f ~/.config/screenlets/GoogleCalendarScreenlet.log
Running update
Checking the Internet connection
Fetching events in calendars from: 2019-05-15T00:00:00+03:00 to 2019-06-05T23:59:59+03:00.
END RETRIEVE
Update failed for some unknown reason.

(我看到上面禁止的词,所以可能是API更改问题)

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2019-05-16 21:26:15

TL;DR -这是不可能的,因为谷歌禁用了ClientLogin,并要求应用程序开发人员使用OAuth 2.0。

详情如下。GoogleCalendarScreenlet是基于python-gdata图书馆的。这个库有专门的Google日历演示程序(它可以从python-gdata-doc包安装)。它可以用/usr/share/doc/python-gdata-doc/examples/calendar/calendarExample.py --user [username] --pw [password]启动

当我启动示例程序时,我得到以下输出:

代码语言:javascript
复制
Traceback (most recent call last):
  File "/usr/share/doc/python-gdata-doc/examples/calendar/calendarExample.py", line 617, in 
    main()
  File "/usr/share/doc/python-gdata-doc/examples/calendar/calendarExample.py", line 613, in main
    sample = CalendarExample(user, pw)
  File "/usr/share/doc/python-gdata-doc/examples/calendar/calendarExample.py", line 51, in __init__
    self.cal_client.ClientLogin(email, password, self.cal_client.source);
  File "/usr/lib/python2.7/dist-packages/gdata/client.py", line 441, in client_login
    captcha_token=captcha_token, captcha_response=captcha_response)
  File "/usr/lib/python2.7/dist-packages/gdata/client.py", line 373, in request_client_login_token
    response, ClientLoginFailed, response_body)
gdata.client.ClientLoginFailed: Server responded to ClientLogin request: 404, https://developers.google.com/accounts/docs/AuthForInstalledApps

访问https://developers.google.com/accounts/docs/AuthForInstalledApps页面提供了一个有趣的引用:

重要: ClientLogin自2012年4月20日起就被正式否决,现在不再可用了。对ClientLogin的请求将在HTTP404响应中失败。我们鼓励您尽快迁移到OAuth 2.0。

因此,这确实是python-gdata库的一个“问题”,而不是GoogleCalendarScreenlet本身。

替代办法:

  • 对于Ubuntu16.04LTS- Rainlendar Pro (它使用OAuth);
  • 对于Ubuntu18.04LTS-具有GNOME演化或GNOME日历的indicator-datetime
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1143493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档