|
@@ -88,12 +88,29 @@ class ConnHandlerBeeWatch(digilib.network.ConnHandlerBase):
|
|
|
cmd=data_decoded
|
|
|
args = ()
|
|
|
kwargs = {}
|
|
|
- self.call(
|
|
|
- cmd,
|
|
|
- respond=self.respond,
|
|
|
- args=args,
|
|
|
- kwargs={},
|
|
|
- )
|
|
|
+ ttf = beewatch._commands
|
|
|
+ if func_name in ttf.keys():
|
|
|
+ try:
|
|
|
+ task = curio.run(
|
|
|
+ ttf[func_name](
|
|
|
+ # self.bee_api,
|
|
|
+ *args,
|
|
|
+ command=cmd,
|
|
|
+ respond=respond,
|
|
|
+ )
|
|
|
+ )
|
|
|
+ except Exception as e:
|
|
|
+ lserver.error("Error while calling api func",exc_info=e)
|
|
|
+ tb = traceback.format_exc()
|
|
|
+ respond(tb)
|
|
|
+ else:
|
|
|
+ respond("Unknown command")
|
|
|
+ # self.call(
|
|
|
+ # cmd,
|
|
|
+ # respond=self.respond,
|
|
|
+ # args=args,
|
|
|
+ # kwargs={},
|
|
|
+ # )
|
|
|
def do(self,func_num,*args,respond):
|
|
|
arg_to_func = {
|
|
|
"1":self.bee_api.do_something_1,
|