Using the Python calendar API sample code to insert an event from an
App Engine page, I am getting a 501 error.

This code works fine running as a standalone module from the Python
command line (i.e. not in App Engine).  Other query calls to retrieve
calendar events work fine from the App Engine app.

Here is the code (called with no arguments):

<code>
def _InsertEvent(title='Tennis with Beth',
    content='Meet for a quick lesson', where='On the courts',
    start_time=None, end_time=None, recurrence_data=None):

  cal_client = gdata.calendar.service.CalendarService()
  cal_client.email = '___'
  cal_client.password = '___'
  cal_client.source = 'Google-Calendar_Python_Sample-1.0'
  cal_client.ProgrammaticLogin()

  event = gdata.calendar.CalendarEventEntry()
  event.title = atom.Title(text=title)
  event.content = atom.Content(text=content)
  event.where.append(gdata.calendar.Where(value_string=where))

  if recurrence_data is not None:
    # Set a recurring event
    event.recurrence = gdata.calendar.Recurrence(text=recurrence_data)
  else:
    if start_time is None:
      # Use current time for the start_time and have the event last 1
hour
      start_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z',
time.gmtime())
      end_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z',
          time.gmtime(time.time() + 3600))
    event.when.append(gdata.calendar.When(start_time=start_time,
        end_time=end_time))

  new_event = cal_client.InsertEvent(event,
      '/calendar/feeds/default/private/full')

  return new_event
</code>

Thanks,
Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to