/usr/share/doc/python3-pyutilib/examples/workflow/example6.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 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 | import pyutilib.workflow
# @ex:
class TaskF1(pyutilib.workflow.Task):
def __init__(self, *args, **kwds):
"""Constructor."""
pyutilib.workflow.Task.__init__(self, *args, **kwds)
self.inputs.declare('a',)
self.inputs.declare('aval')
self.outputs.declare('a', self.inputs.a)
self.outputs.declare('aval', self.inputs.aval)
def execute(self):
pass
class TaskF2(pyutilib.workflow.Task):
def __init__(self, *args, **kwds):
"""Constructor."""
pyutilib.workflow.Task.__init__(self, *args, **kwds)
self.inputs.declare('A',)
self.inputs.declare('Aval')
self.outputs.declare('A', self.inputs.A)
self.outputs.declare('Aval', self.inputs.Aval)
def execute(self):
pass
class TaskG(pyutilib.workflow.Task):
def __init__(self, *args, **kwds):
"""Constructor."""
pyutilib.workflow.Task.__init__(self, *args, **kwds)
self.inputs.declare('x', action='map')
self.inputs.declare('y', action='map')
self.outputs.declare('z')
def execute(self):
"""Compute the sum of the inputs."""
self.z = {}
for key in self.x:
self.z[ self.x[key] ] = self.y[key]
F1 = TaskF1()
F2 = TaskF2()
G = TaskG()
G.inputs.x = F1.outputs.a
G.inputs.y = F1.outputs.aval
G.inputs.x = F2.outputs.A
G.inputs.y = F2.outputs.Aval
w = pyutilib.workflow.Workflow()
w.add(G)
print("IGNORE %s" % str(w(a='a', aval=1, A='A', Aval=2)))
# @:ex
|