PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/doc/decorators/follows.rst

https://code.google.com/p/ruffus/
ReStructuredText | 69 lines | 44 code | 25 blank | 0 comment | 0 complexity | a0f2e0a15ce3e40d3f4698ffede55253 MD5 | raw file
 1.. include:: ../global.inc
 2.. _decorators.follows:
 3.. index:: 
 4    pair: @follows; Syntax
 5
 6.. seealso::
 7
 8    * :ref:`Decorators <decorators>` for more decorators
 9    * More on @follows in the ``Ruffus`` :ref:`Manual <manual.follows>`
10
11
12############
13@follows
14############
15
16.. |task| replace:: `task`
17.. _task: `decorators.follows.task`_
18.. |task_name| replace:: `"task_name"`
19.. _task_name: `decorators.follows.task_name`_
20.. |directory_name| replace:: `directory_name`
21.. _directory_name: `decorators.follows.directory_name`_
22
23***************************************************************************************************************************************************
24*@follows*\ (|task|_ | |task_name|_ | :ref:`mkdir<decorators.mkdir>` (|directory_name|_), [more_tasks, ...])
25***************************************************************************************************************************************************
26    **Purpose:**
27    
28        Indicates task dependencies
29
30
31    **Example**::
32    
33        def task1():
34            print "doing task 1"
35    
36        @follows(task1)
37        def task2():
38            print "doing task 2"
39
40
41    **Parameters:**
42                
43.. _decorators.follows.task:
44 
45    * *task*: 
46        a list of tasks which have to be run **before** this function
47                
48.. _decorators.follows.task_name:
49 
50    * *"task_name"*: 
51        Dependencies can be quoted function names.
52        Quoted function names allow dependencies to be added before the function is defined.
53
54        Functions in other modules need to be fully qualified.
55                
56                
57.. _decorators.follows.directory_name:
58 
59    * *directory_name*:
60        Directories which need to be created (if they don't exist) before
61        the task is run can be specified via a ``mkdir`` indicator object:
62
63            ::
64
65                @follows(task_x, mkdir("/output/directory") ...)
66                def task():
67                    pass
68
69