Fix indentation

This commit is contained in:
Dan Williams 2006-05-05 14:21:53 -04:00
parent f79570edd0
commit 992dbc9662

View File

@ -75,39 +75,40 @@ class GlibXMLRPCServer(GlibTCPServer, SimpleXMLRPCServer.SimpleXMLRPCDispatcher)
SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self) SimpleXMLRPCServer.SimpleXMLRPCDispatcher.__init__(self)
GlibTCPServer.__init__(self, addr, requestHandler) GlibTCPServer.__init__(self, addr, requestHandler)
def _marshaled_dispatch(self, data, dispatch_method = None): def _marshaled_dispatch(self, data, dispatch_method = None):
"""Dispatches an XML-RPC method from marshalled (XML) data. """Dispatches an XML-RPC method from marshalled (XML) data.
XML-RPC methods are dispatched from the marshalled (XML) data XML-RPC methods are dispatched from the marshalled (XML) data
using the _dispatch method and the result is returned as using the _dispatch method and the result is returned as
marshalled data. For backwards compatibility, a dispatch marshalled data. For backwards compatibility, a dispatch
function can be provided as an argument (see comment in function can be provided as an argument (see comment in
SimpleXMLRPCRequestHandler.do_POST) but overriding the SimpleXMLRPCRequestHandler.do_POST) but overriding the
existing method through subclassing is the prefered means existing method through subclassing is the prefered means
of changing method dispatch behavior. of changing method dispatch behavior.
""" """
params, method = xmlrpclib.loads(data) params, method = xmlrpclib.loads(data)
# generate response # generate response
try: try:
if dispatch_method is not None: if dispatch_method is not None:
response = dispatch_method(method, params) response = dispatch_method(method, params)
else: else:
response = self._dispatch(method, params) response = self._dispatch(method, params)
# wrap response in a singleton tuple # wrap response in a singleton tuple
response = (response,) response = (response,)
response = xmlrpclib.dumps(response, methodresponse=1) response = xmlrpclib.dumps(response, methodresponse=1)
except Fault, fault: except Fault, fault:
response = xmlrpclib.dumps(fault) response = xmlrpclib.dumps(fault)
except: except:
traceback.print_exc() print "Exception"
# report exception back to server traceback.print_exc()
response = xmlrpclib.dumps( # report exception back to server
xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)) response = xmlrpclib.dumps(
) xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value))
)
return response return response
class GroupChatController(object): class GroupChatController(object):