[IronPython] gdata calendarservice.Insert
Dino Viehland
dinov at microsoft.com
Tue Mar 17 18:01:23 CET 2009
The method you're trying to call is generic so you need to index into it to provide the generic type:
mycalsvc.Insert[type(myentry)](myposturi, myentry)
We're considering adding inference for these type parameters in the future.
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of starisk11 at gmail.com
Sent: Tuesday, March 17, 2009 9:25 AM
To: users at lists.ironpython.com
Subject: [IronPython] gdata calendarservice.Insert
Hi,
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)
Insert(Uri,Stream,String,String)
Now on the given sample of GDATA which is on CS about Creating calendar events<http://code.google.com/apis/calendar/docs/2.0/developers_guide_dotnet.html#CreatingSingle>, 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<http://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
/full")
>>> 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.
Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090317/b34db917/attachment.html>
More information about the Ironpython-users
mailing list