Commit 853b28e0 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

make possible to link i/o with list of outputs

parent cff56b04
......@@ -70,8 +70,15 @@ class Component(object):
new_param = InputFile(name, help, flag=flag, file_format=file_format, default=default,
type=type, required=required, group=group, display_name=display_name)
new_param.component_nameid = self.get_nameid()
# store where the parameter is coming from
if issubclass( default.__class__, AbstractOutputFile ):
new_param.parent_component_nameid = default.component_nameid
new_param.parent_component_nameid.append(default.component_nameid)
elif issubclass( default.__class__, list ):
for val in default:
if issubclass( val.__class__, AbstractOutputFile ):
new_param.parent_component_nameid.append(val.component_nameid)
# if this input should be added to a particular parameter
if add_to:
try:
......@@ -92,8 +99,15 @@ class Component(object):
new_param = InputFileList(name, help, flag=flag, file_format=file_format, default=default,
type=type, required=required, group=group, display_name=display_name)
new_param.component_nameid = self.get_nameid()
# store where the parameter is coming from
if issubclass( default.__class__, AbstractOutputFile ):
new_param.parent_component_nameid = default.component_nameid
new_param.parent_component_nameid.append(default.component_nameid)
elif issubclass( default.__class__, list ):
for val in default:
if issubclass( val.__class__, AbstractOutputFile ):
new_param.parent_component_nameid.append(val.component_nameid)
# if this input should be added to a particular parameter
if add_to:
try:
......
......@@ -289,7 +289,7 @@ class AbstractIOFile(object):
def __init__(self, file_format="any"):
self.file_format = file_format
self.component_nameid = None
self.parent_component_nameid = None
self.parent_component_nameid = []
class MultiParameter(dict, AbstractParameter):
......
......@@ -282,7 +282,8 @@ class Workflow(threading.Thread):
for ioparameter in cpt.__dict__.values():
if ( issubclass( ioparameter.__class__, InputFile ) or issubclass( ioparameter.__class__, OutputFile)
or issubclass( ioparameter.__class__, InputFileList) or issubclass( ioparameter.__class__, OutputFileList) ):
graph.add_edge({ioparameter.component_nameid, ioparameter.parent_component_nameid})
for pc_nameid in ioparameter.parent_component_nameid:
graph.add_edge({ioparameter.component_nameid, pc_nameid})
return graph
def set_stderr(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment