[IronPython] gdata calendarservice.Insert

starisk11 at gmail.com starisk11 at gmail.com
Tue Mar 17 17:25:21 CET 2009


This is a kinda off-topic, since its a programming issue of Ironpython with
GoogleData CalendarService. Specifically, the "Service.Insert" Method which
is overloaded and can be on any of the following form;

*Insert(TEntry)(Uri, TEntry)
Insert(TEntry)(AtomFeed, TEntry)
Now on the given sample of GDATA which is on CS about Creating calendar
specifically the last line;

// Send the request and receive the response:
AtomEntry insertedEntry = service.Insert(postUri, entry);

How should I code this in python or IronPython? Here is my attempt
that resulted to error.

*>>> import clr
>>> import System
>>> clr.AddReference("mscorlib.dll")
>>> clr.AddReference("Google.GData.Client.dll")
>>> clr.AddReference("Google.GData.Calendar.dll")
>>> clr.AddReference("Google.GData.Extensions.dll")
>>> import Google.GData.Client as GDClient
>>> import Google.GData.Calendar as GDCal
>>> import Google.GData.Extensions as GDxtn
>>> mycalsvc = GDCal.CalendarService("myapp")
>>> mycalsvc.setUserCredentials("******@gmail.com","*******")
>>> myentry = GDCal.EventEntry()
>>> myentry.Title.Text = "Tennis with Beth"
>>> myentry.Content.Content = "Meet for a quick lesson."
>>> myposturi = System.Uri("http://www.google.com/calendar/feeds/default/private
>>> mycalsvc.Insert(myposturi,myentry)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Insert() takes exactly 4 arguments (2 given)
Again, sorry if its off-topic. But I appreciate any help here.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090318/f08ce68e/attachment.html>

More information about the Ironpython-users mailing list