/usr/share/doc/python3-pyutilib/examples/workflow/example1c.py is in python3-pyutilib 5.3.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import pyutilib.workflow
class TaskAA(pyutilib.workflow.Task):
def __init__(self, *args, **kwds):
"""Constructor."""
pyutilib.workflow.Task.__init__(self, *args, **kwds)
self.inputs.declare('x')
self.inputs.declare('y')
self.add_argument('--x', dest='x', type=int)
self.add_argument('--y', dest='y', type=int)
self.outputs.declare('z')
def execute(self):
"""Compute the sum of the inputs."""
self.z = self.x + self.y
# @ex:
AA = TaskAA()
w = pyutilib.workflow.Workflow()
w.add(AA)
w.set_options(['--x=1', '--y=3'])
print(w(y=4))
# @:ex
|