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-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of staris...@gmail.com
Sent: Tuesday, March 17, 2009 9:25 AM
To: users@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





















_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to