Commits

Ali Afshar committed 85a7b2c

Proper dependencies

Comments (0)

Files changed (3)

     :license: LGPL 2 or later (see LICENSE)
 """
 
+from Queue import Queue
+
 import execnet
 
 from bu.preproc import preproc_action
 class ExecutionQueue(object):
 
     def __init__(self, script, target_name):
-        self.queue = []
+        self.queue = Queue()
         self.script = script
         target = script.targets.get(target_name)
         if target is None:
         for action in target.actions:
             self.add_action(action)
 
-
     def add_action(self, action):
-        self.queue.append(ExecutionNode(action))
+        self.queue.put(ExecutionNode(action))
 
     def __iter__(self):
         return iter(self.queue)
+
+Actions
+=======
+
+Each target is composed of one or more actions. These actions are executed
+consecutively. An action is defined by using an action statement within a
+target. If the action statement is omitted, the default action type (shell) is
+used.
+
+The content of the action is executed by the action type as a single block of
+text. The content block *must be indented relative to the toplevel*.
+
+Back to our hello world example:
+
+.. code-block:: bu
+
+    hello:
+        echo hello world
+
+In our simple hello world example, the action is ``echo hello world`` and
+since the action type is omitted, a shell action is used. The same example can
+be written explicitly specifying a shell action like so:
+
+.. code-block:: bu
+
+    hello:
+        !sh
+        echo hello world
+
+Action content need not only be a single line, the entire block follwing the
+the !sh statement is executed by the same shell:
+
+.. code-block:: bu
+
+    hello:
+        !sh
+        export TEST=1
+        echo $TEST
+
+Multiple actions can be contained in a target. In this case each action is
+executed in a separate shell:
+
+.. code-block:: bu
+
+    hello:
+        !sh
+        echo hello world
+        !sh
+        echo hello world
+
+Actions may also be Python scripts. The Python indent level must be consistent
+and relative to the first line of the action, and inconsistent indenting is an
+error:
+
+.. code-block:: bu
+
+    hello:
+        !py
+        for i in range(3):
+            print 'Hello World'
+
+

docs/options.rst

Empty file added.