trying to wrap xmlrpclib into classes

Steven Noels stevenn at outerthought.org
Wed Jan 22 09:34:18 EST 2003


Skip Montanaro wrote:

>     Steven> I'm trying to wrap things in order to make it feel less
>     Steven> XMLRPC'ish:
> 
> I'm coming in late to this thread, but use XML-RPC all the time.  Other than
> the initial setup of a server proxy and the fact that XML-RPC can't quite
> pass all Python data types, can you describe what "XMLRPC'ish" is?

Having to pass in xmlrpclib.DateTime objects into certain methods, and 
this 'server object' that is hanging around in your logic which I don't 
like. But I'm a newbie, so my taste might be wrong. My client code looks 
like this right now:

page = Page('Main', 'http://wiki.cocoondev.org/RPC2/')
pageInfo = page.retrievePageInfo()
version = page.getVersion()
author = page.getAuthor()
lastModified = page.getlastModified()

twodays = 60*60*24*2
twodaysago = time.gmtime(time.time() - twodays)
changes = RecentChanges('http://wiki.cocoondev.org/RPC2/')
rc = changes.getRecentChanges(twodaysago)

rc being a dictionary of a sequence of built-in types with a proper 
lookup key rather than a list of dictionary objects which the default 
xmlrpclib creates for an XMLRPC array.

But as I said, this is my first venture into Python programming, so do 
not hesitate to nail me down :)

</Steven>
-- 
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 mailing list