Commit 46687289 authored by Frédéric Escudié's avatar Frédéric Escudié
Browse files

Fix bug with str in add_input_file_list

parent d465346d
...@@ -91,8 +91,10 @@ class Component(object): ...@@ -91,8 +91,10 @@ class Component(object):
required=False, flag=None, group="default", display_name=None, add_to=None): required=False, flag=None, group="default", display_name=None, add_to=None):
if default == None: if default == None:
inputs = [] inputs = []
else: elif issubclass(default.__class__, list):
inputs = [IOFile(file, file_format, self.get_nameid(), None) for file in default] inputs = [IOFile(file, file_format, self.get_nameid(), None) for file in default]
else:
inputs = [IOFile(default, file_format, self.get_nameid(), None)]
new_param = InputFileList(name, help, flag=flag, file_format=file_format, default=inputs, new_param = InputFileList(name, help, flag=flag, file_format=file_format, default=inputs,
type=type, required=required, group=group, display_name=display_name) type=type, required=required, group=group, display_name=display_name)
# store where the parameter is coming from # store where the parameter is coming from
......
...@@ -178,7 +178,13 @@ class Workflow(threading.Thread): ...@@ -178,7 +178,13 @@ class Workflow(threading.Thread):
if default == None: default = [] if default == None: default = []
try: int(get_nb_octet(size_limit)) try: int(get_nb_octet(size_limit))
except: size_limit="0" except: size_limit="0"
new_param = InputFileList(name, help, flag=flag, file_format=file_format, default=default, if default == None:
inputs = []
elif issubclass(default.__class__, list):
inputs = [IOFile(file, file_format, name, None) for file in default]
else:
inputs = [IOFile(default, file_format, name, None)]
new_param = InputFileList(name, help, flag=flag, file_format=file_format, default=inputs,
type=type, required=required, group=group, display_name=display_name, size_limit=size_limit) type=type, required=required, group=group, display_name=display_name, size_limit=size_limit)
new_param.component_nameid = name new_param.component_nameid = name
# if this input should be added to a particular parameter # if this input should be added to a particular parameter
......
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