summaryrefslogtreecommitdiff
path: root/xmlrpcutils.py
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 02:07:55 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2009-07-19 02:07:55 +0200
commita1cdde3320add8bbe4557639488bb4d2ef2861fd (patch)
treef579949c7a7fb9b4efb8a6ccdfcd35484854662b /xmlrpcutils.py
parent6bb5a230a8df5ed2fe417c7b85491073da50dfd3 (diff)
downloadlogilab-common-a1cdde3320add8bbe4557639488bb4d2ef2861fd.tar.gz
[cleanup] delete-trailing-whitespace
Diffstat (limited to 'xmlrpcutils.py')
-rw-r--r--xmlrpcutils.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/xmlrpcutils.py b/xmlrpcutils.py
index b31d02f..5d69142 100644
--- a/xmlrpcutils.py
+++ b/xmlrpcutils.py
@@ -18,21 +18,21 @@ ProtocolError = xmlrpclib.ProtocolError
## self.password = password
## self.verbose = None
## self.has_ssl = httplib.__dict__.has_key("HTTPConnection")
-
+
## def request(self, host, handler, request_body, verbose=None):
## # issue XML-RPC request
## if self.has_ssl:
## if host.startswith("https:"): h = httplib.HTTPSConnection(host)
## else: h = httplib.HTTPConnection(host)
## else: h = httplib.HTTP(host)
-
+
## h.putrequest("POST", handler)
-
+
## # required by HTTP/1.1
## if not self.has_ssl: # HTTPConnection already does 1.1
## h.putheader("Host", host)
## h.putheader("Connection", "close")
-
+
## if request_body: h.send(request_body)
## if self.has_ssl:
## response = h.getresponse()
@@ -47,22 +47,22 @@ ProtocolError = xmlrpclib.ProtocolError
## if errcode != 200:
## raise xmlrpclib.ProtocolError(host + handler, errcode,
## errmsg, headers)
-
+
## file = h.getfile()
-
+
## return self.parse_response(file)
-
+
class AuthMixin:
"""basic http authentication mixin for xmlrpc transports"""
-
+
def __init__(self, username, password, encoding):
self.verbose = 0
self.username = username
self.password = password
self.encoding = encoding
-
+
def request(self, host, handler, request_body, verbose=0):
"""issue XML-RPC request"""
h = self.make_connection(host)
@@ -96,10 +96,10 @@ class AuthMixin:
## result.seek(0)
## return self.parse_response(result)
return self.parse_response(file)
-
+
class BasicAuthTransport(AuthMixin, xmlrpclib.Transport):
"""basic http authentication transport"""
-
+
class BasicAuthSafeTransport(AuthMixin, xmlrpclib.SafeTransport):
"""basic https authentication transport"""