trying to wrap xmlrpclib into classes
stevenn at outerthought.org
Wed Jan 22 20:54:50 CET 2003
Skip Montanaro wrote:
> Steven> page = Page('Main', 'http://wiki.cocoondev.org/RPC2/')
> Since the default path is "/RPC2" (that is, xmlrpclib will send a POST
> request to the server with "/RPC2" as the path), why are you giving that?
In this case, the XMLRPC endpoint is located at /RPC2/ for some strange
reason, not at /RPC2
> Steven> pageInfo = page.retrievePageInfo()
> Steven> version = page.getVersion()
> Steven> author = page.getAuthor()
> Steven> lastModified = page.getlastModified()
> This looks very vanilla.
> Steven> twodays = 60*60*24*2
> Steven> twodaysago = time.gmtime(time.time() - twodays)
> Steven> changes = RecentChanges('http://wiki.cocoondev.org/RPC2/')
> Steven> rc = changes.getRecentChanges(twodaysago)
> As does this. Do you wrap twodaysago in a DateTime object locally or just
> pass it along as a tuple?
tuple - is that OK?
> Steven> rc being a dictionary of a sequence of built-in types with a
> Steven> proper lookup key rather than a list of dictionary objects which
> Steven> the default xmlrpclib creates for an XMLRPC array.
> This I can't quite parse. Are you complaining that it does something funky
> with lists or dicts? Can you give a concrete example?
an XMLRPC array is translated in a list of dictionary objects, IIUC,
which is a bit awkward to navigate
for my application, I prefered to wrap that into a dictionary of tuples,
providing easier access to the items in the array. Maybe, after having
learned more about the different data types, I might come up with
Is this more clear?
thanks for your comments,
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
More information about the Python-list