使用 gdata python 库发送 Google 日历活动邀请通知
我正在使用 Google 的 gdata 库在 python 中以编程方式创建日历事件。到目前为止,以下代码工作正常,除了一件事:
我一生都无法让它向被邀请者(或被邀请者列表)发送邀请通知:
import datetime
import atom
import gdata.calendar.service
from gdata.calendar import Who, Where, When
entry = gdata.calendar.CalendarEventEntry()
entry.title = atom.Title(text = 'event-title')
entry.content = atom.Content(text = 'some event etc...')
entry.send_event_notifications = atom.Entry(text = 'true') #<<<<<<<<<<<<<<<<<
start = datetime.datetime.now().isoformat()
entry.when.append(When(start_time=start))
entry.where.append(Where(value_string='somewhere'))
entry.who.append(Who(email = '[email protected]'))
client = gdata.calendar.service.CalendarService(email='[email protected]', password='pa$$word')
client.ProgrammaticLogin()
event = client.InsertEvent(entry,'http://www.google.com/calendar/feeds/default/private/full')
标记行是我认为有必要发送的内容邀请通知,但不起作用。有什么想法吗?
I am using Google's gdata library to create calendar events programmatically in python. So far the following code is working fine except for one thing:
I can't for the life of me get it to send an invite notification to the invitee (or list of invitees):
import datetime
import atom
import gdata.calendar.service
from gdata.calendar import Who, Where, When
entry = gdata.calendar.CalendarEventEntry()
entry.title = atom.Title(text = 'event-title')
entry.content = atom.Content(text = 'some event etc...')
entry.send_event_notifications = atom.Entry(text = 'true') #<<<<<<<<<<<<<<<<<
start = datetime.datetime.now().isoformat()
entry.when.append(When(start_time=start))
entry.where.append(Where(value_string='somewhere'))
entry.who.append(Who(email = '[email protected]'))
client = gdata.calendar.service.CalendarService(email='[email protected]', password='pa$word')
client.ProgrammaticLogin()
event = client.InsertEvent(entry,'http://www.google.com/calendar/feeds/default/private/full')
The marked line is what I think is necessary to send the invite notifications, but it's not working. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,正确的语法是:
Actually, the proper syntax is:
您可以使用:
You may use: