Added CommandStack.explicit_user_call to distinguish user- from UI-generated calls.
[hooke.git] / hooke / plugin / command_stack.py
index 8a3ecb829c6d8527224a7b779e860356b91303c4..b5c987cdc94632c4ce2c5358e4ccb0ce1e69c3da 100644 (file)
@@ -81,7 +81,8 @@ class CaptureCommand (CommandStackCommand):
                 return
             assert isinstance(msg, CommandMessage), type(msg)
             cmd = hooke.command_by_name[msg.command]
-            if isinstance(cmd, CommandStackCommand):
+            if (cmd.explicit_user_call == False
+                or isinstance(cmd, CommandStackCommand)):
                 if isinstance(cmd, StopCaptureCommand):
                     outqueue = Queue()  # Grab StopCaptureCommand's completion.
                 cmd.run(hooke, inqueue, outqueue, **msg.arguments)
@@ -282,8 +283,6 @@ current stack.
 """.strip()),
                 ],
             help=self.__doc__, plugin=plugin)
-        stack = [a for a in self.arguments if a.name == 'stack'][0]
-        stack.default = False
 
     def _run(self, hooke, inqueue, outqueue, params):
         params = self.__setup_params(hooke=hooke, params=params)