#!/usr/bin/env python
import sys, os
from ecflow import *
#path = "/home/ma/emos/def/o/def"
#sys.path.append(path)
#from ecf import *
client = Client(os.getenv('ECF_HOST', "localhost"),
os.getenv('ECF_PORT', "31415"))
client.ch_register(False, [ "test", "suite"])
client.sync_local()
defs = client.get_defs()
def process(node):
if isinstance(node, ecflow.Task): print "task",
elif isinstance(node, ecflow.Family): print "family",
elif isinstance(node, ecflow.Suite): print "suite",
elif isinstance(node, ecflow.Alias): print "alias",
else: print "???",
print node.get_abs_node_path(), node.get_state(),
"T:", node.get_trigger(), "C:", node.get_complete()
for item in node.nodes: process(item)
for item in defs.suites: process(item)