diff --git a/fluents/workflow.py b/fluents/workflow.py index 6509e51..07c9e95 100644 --- a/fluents/workflow.py +++ b/fluents/workflow.py @@ -46,6 +46,21 @@ def workflow_list(): return retval +def find_workflow(basename): + """Searches for a workflow with a given filename.""" + print "find_workflow" + + # List all .py files that can contain workflow classes + wf_path = sys.path + wf_file = None + + for dir in wf_path: + fn = os.path.join(dir, "%s.py" % basename) + if os.path.isfile(fn): + wf_file = fn + return _workflow_classes(basename)[0] + + return None class Workflow: """Defines a workflow that contains a set of analysis stages.