...
The following examples show alternative styles of adding suites,families and tasks: They produce exactly the same suite as the first.
Code Block |
---|
| from ecflow import ecflow*
with ecflow.Defs() as defs:
with defs.add_suite("s1") as suite:
with suite.add_family("f1") as family:
for i in [ "a", "b", "c" ]:
family.add_task( "t" + i)
defs.save_as_defs("test.def") |
|
Code Block |
---|
| from ecflow import ecflow*
defs = ecflow.Defs().add(
ecflow.Suite("s1").add(
ecflow.Family("f1").add(
[ ecflow.Task("t{}".format(t))
for t in ("a", "b", "c")])))
defs.save_as_defs("test.def") |
|
Code Block |
---|
| from ecflow import ecflow*
defs = ecflow.Defs()
defs += [ ecflow.Suite("s1") ]
defs.s1 += [ ecflow.Family("f1") ]
defs.s1.f1 += [ ecflow.Task("t{}".format(t))
for t in ("a", "b", "c")]
defs.save_as_defs("test.def") |
|
...