File: Edit.rst

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (58 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ecflow.Edit
///////////


.. py:class:: Edit
   :module: ecflow

   Bases: :py:class:`~Boost.Python.instance`

Defines a :term:`variable` on a :term:`node` for use in :term:`ecf script`.

A Node can have a number of variables.
These variables can be added at any node level: Defs, :term:`suite`, :term:`family` or :term:`task`.
The variables are names inside a pair of '%' characters in an :term:`ecf script`.
The content of a variable replaces the variable name in the :term:`ecf script` at
job submission time. When a variable is needed at submission time, it is first
sought in the task itself. If it is not found, it is sought from the tasks parent
and so on, up through the node levels until found. See :term:`variable inheritance`
A undefined variable in a :term:`ecf script`, causes the :term:`task` to be :term:`aborted`,
without the job being submitted.

Constructor::

   Variable(name,value)
      string name: the name of the variable
      string value: The value of the variable

   Edit(dict,kwarg) # alternative that allows multiple variables

Usage:

.. code-block:: python

   ...
   var = Variable('ECF_JOB_CMD','/bin/sh %ECF_JOB% &')
   task.add_variable(var)
   task.add_variable('JOE','90')

The following use example of using Edit, which allow multiple variables to added at the same time :

.. code-block:: python

   t = Task('t1',
             Edit({ 'a':'y', 'b':'bb'}, c='v',d='b'),
             Edit({ 'e':1100, 'f':'bb'}),
             Edit(g='d'),
             Edit(h='1'))

.. code-block:: python

  defs = Defs(
            Suite('s1'),
            Edit(SLEEP='1')) # Add user variable to definition
  defs.s1 += [ Task('a') ]
  defs.s1.a += [ Edit({ 'x1':'y', 'aa1':'bb'}, a='v',b='b'),
                 Edit({ 'var':10, 'aa':'bb'}),
                 Edit(d='d') ]