Преглед изворни кода

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)