3
def addEvent(calendar_service):
    event = gdata.calendar.CalendarEventEntry()
    event.content = atom.Content(text='Tennis with John 30.12.2009 15:00-16:00')
    event.quick_add = gdata.calendar.QuickAdd(value='true')
    new_event = calendar_service.InsertEvent(event, '/calendar/feeds/default/private/full')

这写入主日历。如何将/InsertEvent 写入我的“foo”日历?
谢谢!

4

2 回答 2

3

好的,我在a_calendar.content.src中找到了 URL,它显示为“ http://www.google.com/calendar/feeds/”+id+“/private/full

def addEvent(calendar_service):
    event = gdata.calendar.CalendarEventEntry()
    event.content = atom.Content(text='Tennis with John 30.12.2009 15:00-16:00')
    event.quick_add = gdata.calendar.QuickAdd(value='true')
    feed = calendar_service.GetOwnCalendarsFeed()
    calurl=[a_calendar.content.src for i, a_calendar in enumerate(feed.entry)]
    new_event = calendar_service.InsertEvent(event, calurl[1]) #calurl[1] select the 2. cal of own's cals
于 2009-12-29T08:26:49.930 回答
0

尝试为 InsertEvent 指定不同的 URL。请参阅有关检索日历的文档,或者尝试使用 GET 访问列出的 URL。在 InsertEvent 调用中使用检索到的日历的 URL,而不是“/calendar/feeds/default/private/full”。


于 2009-12-29T01:03:04.850 回答