views:

5

answers:

0

I want to extract location from event. Or field Where in google calendar when you add location.

def PrintUserCalendars(calendar_service):
    all_calendars_feed = calendar_service.GetAllCalendarsFeed()

    for i, cal in enumerate(all_calendars_feed.entry):
        print "%d) %s" % (i, cal.title.text)
        print "\tPublished: %s \n\tUpdated: %s \n\ttimezone: %s" % (cal.published.text, cal.updated.text, cal.timezone.value)
        print "\tColour: %s \n\tHidden: %s \n\tSelected: %s" % (cal.color.value, cal.hidden.value, cal.selected.value)
        print "\tAccess Level: %s" % (cal.access_level.value)

        a_link = cal.GetAlternateLink()

        if (a_link is not None):
            event_feed = calendar_service.GetCalendarEventFeed(a_link.href)
            print "\tUrl: %s" % (a_link.href)
            for j, event in enumerate(event_feed.entry):
                print "\t\tEvent title: %s" % (event.title.text)
                print "\t\tEvent location: %s" % (event.where.text) # code breaks here