Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Added function to specify a specific workflow based on module name.

This commit is contained in:
Einar Ryeng 2007-12-11 11:40:27 +00:00
parent 9242b88d07
commit c862c8bb04
1 changed files with 15 additions and 0 deletions

View File

@ -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.