-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+# Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Hooke. If not, see
#
# You should have received a copy of the GNU Lesser General Public
# License along with Hooke. If not, see
class CommandEngine (object):
def run(self, hooke, ui_to_command_queue, command_to_ui_queue):
"""Get a :class:`hooke.ui.QueueMessage` from the incoming
class CommandEngine (object):
def run(self, hooke, ui_to_command_queue, command_to_ui_queue):
"""Get a :class:`hooke.ui.QueueMessage` from the incoming
`command_to_ui_queue`, at which point the `CommandEngine` will
be ready to receive the next :class:`hooke.ui.QueueMessage`.
"""
`command_to_ui_queue`, at which point the `CommandEngine` will
be ready to receive the next :class:`hooke.ui.QueueMessage`.
"""
msg = ui_to_command_queue.get()
if isinstance(msg, CloseEngine):
command_to_ui_queue.put(hooke)
msg = ui_to_command_queue.get()
if isinstance(msg, CloseEngine):
command_to_ui_queue.put(hooke)
msg.command.run(hooke, ui_to_command_queue, command_to_ui_queue,
**msg.arguments)
msg.command.run(hooke, ui_to_command_queue, command_to_ui_queue,
**msg.arguments)