[Python-Dev] xmlrpclib + proxy support followup
Bill Bumgarner
bbum@codefab.com
Thu, 5 Dec 2002 12:13:27 -0500
</F>,
I'm in the midst of implementing the Proxy support in xmlrpclib's
Transport pattern and have a [minor] patch that seems to be necessary
to my implementation. I say 'seems' because I'm not that far in yet
and may discover something else that makes this particular path of
implementation invalid [but I don't think so].
In particular, my goal is to implement a subclass of Transport that
leverages the capabilities of urllib2 to provide Proxy support, HTTPs
support, etc.. in a single class. The goal is to provide the
implementation entirely through the methods provided for creating and
sending the request. That is, through make_connection(),
send_request(), send_host(), send_user_agent(), and send_content().
However, I need a sixth method -- get_reply().
I patched the Transport class in xmlrpclib as such:
def request(self, host, handler, request_body, verbose=0):
# issue XML-RPC request
....
errcode, errmsg, headers = self.get_reply(h)
....
def get_reply(self, connection):
return connection.getReply()
This would seem to be a trivial change to the existing xmlrpclib that
greatly increases the ability to modify its behavior via subclassing,
etc...
Onwards,
b.bum