Add successful Curve.command_stack maintenance.
[hooke.git] / hooke / engine.py
index e5fd184c3fed2181b923f2dd67c6dc7bea262861..75f74fe2a48908ee5787559b80649a8b194200d0 100644 (file)
@@ -21,6 +21,7 @@
 """
 
 import logging
+from Queue import Queue, Empty
 
 from .command import NullQueue
 
@@ -88,7 +89,15 @@ class CommandEngine (object):
         communication queues, so make sure they will not need user
         interaction.
         """
+        log = logging.getLogger('hooke')
         log.debug('engine running internal %s with %s'
                   % (command, arguments))
         cmd = hooke.command_by_name[command]
-        cmd.run(hooke, NullQueue(), NullQueue(), arguments)
+        outqueue = Queue()
+        cmd.run(hooke, NullQueue(), outqueue, **arguments)
+        while True:
+            try:
+                msg = outqueue.get(block=False)
+            except Empty:
+                break
+            log.debug('engine message from %s (%s): %s' % (command, type(msg), msg))