Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Python

The following section shows how to add a ecflow.Label in python: ( Note: families f1 and f2 are omitted for brevity)

Code Block
languagepy
title$HOME/course/test.py
#!/usr/bin/env python2.7
import os
from ecflow import Defs,Suite,Family,Task,Edit,Trigger,Complete,Event,Meter,Time,Day,Date,Label

def create_family_f3():
    return Family("f3",
                Task("t1",
                Label("info","")))
 
print("Creating suite definition")  
home = os.path.join(os.getenv("HOME"), "course")
defs = Defs( 
        Suite("test",
            Edit(ECF_INCLUDE=home,ECF_HOME=home),
            create_family_f3()))
print(defs) 

print("Checking job creation: .ecf -> .job0")  
#printprint(defs.check_job_creation())

print("Checking trigger expressions")
assert len(defs.check()) == 0, defs.check()

print("Saving definition to file 'test.def'")
defs.save_as_defs("test.def")

What to do

  1. Modify the suite definition file or python script
  2. Create the new ecf script file $HOME/course/test/f3/t1.ecf
  3. Replace the suite definition
  4. Watch in ecflow_ui
       

...