예제 #1
0
 def dispatch(self, action, request, *args, **kwargs):
     if not hasattr(self, action):
         raise NotFound()
     return getattr(self, action)(request, *args, **kwargs)
예제 #2
0
파일: api.py 프로젝트: sunxun-1/jet-bridge
 def dispatch(self, action, *args, **kwargs):
     if not hasattr(self, action):
         raise NotFound()
     response = yield as_future(lambda: getattr(self, action)(*args, **kwargs))
     raise gen.Return(response)