Cool.. glad it works. Just be careful not to expose methods you may not
want to; use decorators, attributes, or perhaps a custom method naming
scheme to flag methods as exposed if you do it this way.
On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Sep 27, 5:08 pm, "Jeff McNeil" <[
On Sep 27, 5:08 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote:
> Yeah, that code was out of memory and I didn't test it, my apologies.
> Need to actually return a value from _dispatch.
>
> class MyCalls(object):
>def _dispatch(self, method, args):
>try:
>return getattr(self, m
Yeah, that code was out of memory and I didn't test it, my apologies.
Need to actually return a value from _dispatch.
class MyCalls(object):
def _dispatch(self, method, args):
try:
return getattr(self, method)(*args)
except:
handle_logging()
server = SimpleX
On Sep 27, 3:55 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote:
> Instead of register_function, use register_instance and provide a
> _dispatch method in that instance that handles your exception logging.
>
> Pseudo:
>
> class MyCalls(object):
> def _dispatch(self, method, args):
> try:
>
getattr, not self.getattr.
On 9/27/07, Jeff McNeil <[EMAIL PROTECTED]> wrote:
> Instead of register_function, use register_instance and provide a
> _dispatch method in that instance that handles your exception logging.
>
> Pseudo:
>
> class MyCalls(object):
> def _dispatch(self, method, args):
Instead of register_function, use register_instance and provide a
_dispatch method in that instance that handles your exception logging.
Pseudo:
class MyCalls(object):
def _dispatch(self, method, args):
try:
self.getattr(self, method)(*args)
except:
han
[EMAIL PROTECTED] a écrit :
> I have a pretty simple XMLRPCServer, something along the lines of the
> example:
>
> server = SimpleXMLRPCServer(("localhost", 8000))
> server.register_function(pow)
> server.register_function(lambda x,y: x+y, 'add')
> server.serve_forever()
>
> Now what I want to do
I have a pretty simple XMLRPCServer, something along the lines of the
example:
server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.serve_forever()
Now what I want to do is catch any errors that happen on requests,