__init__(self,
command,
args=None,
env=None,
input=None,
output=None,
name=None)
(Constructor)
| source code
|
Create an input record for the dag_t describing a command. The command can be a string
to execute or a python function or a list of strings and python
functions. The python function will be passed two arguments: args and
env. args is typically a list, but could be anything.
The input and output lists of files are used by the dag_t to order this
command relative to other commands.
When the command is a python function, the python function is called
with two arguments: args and an env of type env_t. The args can
be anything but are typically the inputs to the python function and any
information required to generate the corresponding outputs. The python
functions return a 2-typle (retcode, stdout).
The input list: When the command is a python function, the plan_t's
input list contains at least the input files names passed via args
variable. The input list can be a superset containing more stuff that
might trigger the command execution.
If the command does not produce a specific output, you can specify a
dummy file name to allow sequencing relative to other commands.
- Parameters:
command (string or python function or a list) - string or python function.
args (list) - (optional) arguments to the command if it is a python function
env (env_t) - (optional) an environment to pass to the python function
input (list) - (optional) files upon which this command depends.
output (list) - (optional) files which depend on this command.
name (string) - (optional) short name to be used to identify the work/task
- Overrides:
object.__init__
|