The engine module provides CommandEngine for executing hooke.command.Commands.
Methods
run | |
run_command |
Get a QueueMessage from the incoming ui_to_command_queue and act accordingly.
If the message is a CommandMessage instance, the command run may read subsequent input from ui_to_command_queue (if it is an interactive command). The command may also put assorted data into command_to_ui_queue.
When the command completes, it will put a hooke.command.CommandExit instance into command_to_ui_queue, at which point the CommandEngine will be ready to receive the next QueueMessage.
Run the command named command with arguments using run_command().
This allows commands to execute sub commands and enables CommandStack execution.
Note that these commands do not have access to the usual UI communication queues, so make sure they will not need user interaction.
A message storing a command to run, command should be the name of a hooke.command.Command instance, and arguments should be a dict with argname keys and value values to be passed to the command.
Message is explicitly user-executed. This is useful for distinguishing auto-generated calls (for which explicit_user_call should be False such as the GUIs current status requests.