浏览代码

api functions now get a list of args insted *args

digital 8 年之前
父节点
当前提交
8411c91b00
共有 1 个文件被更改,包括 7 次插入8 次删除
  1. 7 8
      lib/beewatch/server/__init__.py

+ 7 - 8
lib/beewatch/server/__init__.py

@@ -89,15 +89,14 @@ class ConnHandlerBeeWatch(digilib.network.ConnHandlerBase):
             args = ()
         kwargs = {}
         ttf = beewatch._commands
-        if func_name in ttf.keys():
+        if cmd in ttf.keys():
             try:
-                task = curio.run(
-                    ttf[func_name](
-                        # self.bee_api,
-                        *args,
-                        command=cmd,
-                        respond=respond,
-                    )
+                task = cmd.run(
+                    ttf[cmd],
+                    # self.bee_api,
+                    args=args,
+                    command=cmd,
+                    respond=respond,
                 )
             except Exception as e:
                 lserver.error("Error while calling api func",exc_info=e)