Message117886
It's easy enough to subclass the Transport type and add custom types to the dispatcher object, see the script below.
Attila, Bhargav, is this solution acceptable to you?
from xmlrpclib import Transport, ServerProxy
class MyTransport(Transport):
def getparser(self):
parser, unmarshaller = Transport.getparser(self)
# Get the class attribute, clone it
dispatch = unmarshaller.dispatch.copy()
# and store it on the instance
unmarshaller.dispatch = dispatch
# Now we can add custom types
dispatch["ex:i8"] = dispatch["int"]
return parser, unmarshaller
uri = "http://time.xmlrpc.com/RPC2"
server = ServerProxy(uri, transport=MyTransport(use_datetime=True))
print server.currentTime.getCurrentTime() |
|
Date |
User |
Action |
Args |
2010-10-02 16:58:17 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, loewis, bquinlan, bra, bhargav |
2010-10-02 16:58:16 | amaury.forgeotdarc | set | messageid: <1286038696.96.0.282287891723.issue8792@psf.upfronthosting.co.za> |
2010-10-02 16:58:15 | amaury.forgeotdarc | link | issue8792 messages |
2010-10-02 16:58:14 | amaury.forgeotdarc | create | |
|