Commit 8f805fb0 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

fix a bug when linking workflow inputs

parent f1974310
......@@ -387,11 +387,11 @@ class AbstractIOFile(LinkTraceback):
class IOFile(str, AbstractIOFile):
def __new__(self, val="", file_format="any", component_nameid=None, parent_component_nameid=None):
def __new__(self, val="", file_format="any", linkTrace_nameid=None, parent_linkTrace_nameid=None):
return str.__new__(self, val)
def __init__(self, val="", file_format="any", component_nameid=None, parent_component_nameid=None):
AbstractIOFile.__init__(self, file_format, component_nameid, parent_component_nameid)
def __init__(self, val="", file_format="any", linkTrace_nameid=None, parent_linkTrace_nameid=None):
AbstractIOFile.__init__(self, file_format, linkTrace_nameid, parent_linkTrace_nameid)
class MultiParameter(dict, AbstractParameter):
......
......@@ -286,14 +286,19 @@ class Workflow(threading.Thread):
group=parameter.group, display_name=parameter.display_name )
elif parameter.__class__ == InputFileList:
if value == "" : value = [] # from GUI
new_param = InputFileList( parameter.name, parameter.help, file_format=parameter.file_format, default=parameter.prepare_input_files(value),
iovalues = []
for file in parameter.prepare_input_files(value):
iovalues.append(IOFile(file, parameter.file_format, parameter.linkTrace_nameid, None))
new_param = InputFileList( parameter.name, parameter.help, file_format=parameter.file_format, default=iovalues,
type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag,
group=parameter.group, display_name=parameter.display_name, size_limit=parameter.size_limit )
new_param.linkTrace_nameid = parameter.linkTrace_nameid
elif parameter.__class__ == InputFile:
if value == "" : value = None # from GUI
new_param = InputFile( parameter.name, parameter.help, file_format=parameter.file_format, default=parameter.prepare_input_file(value),
type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag,
group=parameter.group, display_name=parameter.display_name )
new_param.linkTrace_nameid = parameter.linkTrace_nameid
else:
raise Exception( "Unknown class '" + parameter.__class__.__name__ + "' for parameter.")
return new_param
......
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