示例#1
0
 def dispatch(self, call):
     """
     Dispatch the call to the handler.
     :param call: A *call* document.
     :type call: Document
     """
     reply = Document()
     try:
         method = getattr(self.handler, call.name)
         result = method(*call.args, **call.kwargs)
         reply.code = 0
         reply.result = result
     except Exception, e:
         reply.code = 1
         reply.result = utf8(e)
示例#2
0
文件: manager.py 项目: stbenjam/gofer
 def dispatch(self, call):
     """
     Dispatch the call to the handler.
     :param call: A *call* document.
     :type call: Document
     """
     reply = Document()
     try:
         method = getattr(self.handler, call.name)
         result = method(*call.args, **call.kwargs)
         reply.code = 0
         reply.result = result
     except Exception, e:
         reply.code = 1
         reply.result = utf8(e)
示例#3
0
 def __call__(self, *args, **kwargs):
     try:
         result = self.call(*args, **kwargs)
     except Exception, e:
         reply = Document()
         reply.code = 1
         reply.result = utf8(e)
         result = reply
示例#4
0
文件: manager.py 项目: stbenjam/gofer
 def __call__(self, *args, **kwargs):
     try:
         result = self.call(*args, **kwargs)
     except Exception, e:
         reply = Document()
         reply.code = 1
         reply.result = utf8(e)
         result = reply
示例#5
0
文件: manager.py 项目: jortel/gofer
 def __call__(self, *args, **kwargs):
     try:
         result = self.call(*args, **kwargs)
     except Exception as e:
         reply = Document()
         reply.code = 1
         reply.result = str(e)
         result = reply
     return result
示例#6
0
 def __call__(self, *args, **kwargs):
     try:
         result = self.call(*args, **kwargs)
     except Exception as e:
         reply = Document()
         reply.code = 1
         reply.result = str(e)
         result = reply
     return result