many pep8 improvements
This commit is contained in:
@@ -46,8 +46,10 @@ class JSONDummyParser:
|
||||
"json wrapper for xmlrpclib parser interfase"
|
||||
def __init__(self):
|
||||
self.buf = StringIO()
|
||||
|
||||
def feed(self, data):
|
||||
self.buf.write(data)
|
||||
|
||||
def close(self):
|
||||
return self.buf.getvalue()
|
||||
|
||||
@@ -72,6 +74,7 @@ class JSONTransportMixin:
|
||||
class JSONTransport(JSONTransportMixin, Transport):
|
||||
pass
|
||||
|
||||
|
||||
class JSONSafeTransport(JSONTransportMixin, SafeTransport):
|
||||
pass
|
||||
|
||||
@@ -79,7 +82,7 @@ class JSONSafeTransport(JSONTransportMixin, SafeTransport):
|
||||
class ServerProxy(object):
|
||||
"JSON RPC Simple Client Service Proxy"
|
||||
|
||||
def __init__(self, uri, transport=None, encoding=None, verbose=0):
|
||||
def __init__(self, uri, transport=None, encoding=None, verbose=0):
|
||||
self.location = uri # server location (url)
|
||||
self.trace = verbose # show debug messages
|
||||
self.exceptions = True # raise errors? (JSONRPCError)
|
||||
@@ -88,7 +91,7 @@ class ServerProxy(object):
|
||||
|
||||
type, uri = urllib.splittype(uri)
|
||||
if type not in ("http", "https"):
|
||||
raise IOError, "unsupported JSON-RPC protocol"
|
||||
raise IOError("unsupported JSON-RPC protocol")
|
||||
self.__host, self.__handler = urllib.splithost(uri)
|
||||
|
||||
if transport is None:
|
||||
@@ -118,7 +121,7 @@ class ServerProxy(object):
|
||||
self.__handler,
|
||||
request,
|
||||
verbose=self.__verbose
|
||||
)
|
||||
)
|
||||
|
||||
# store plain request and response for further debugging
|
||||
self.json_request = request
|
||||
|
||||
Reference in New Issue
Block a user