Commit 954672ca authored by Ibouniyamine Nabihoudine's avatar Ibouniyamine Nabihoudine
Browse files

No commit message

No commit message
parent 1dc1e730
...@@ -757,16 +757,10 @@ class InputDirectory(StrParameter, LinkTraceback): ...@@ -757,16 +757,10 @@ class InputDirectory(StrParameter, LinkTraceback):
StrParameter.__init__(self, name, help, flag=flag, default=default, type="inputdirectory", choices=choices, StrParameter.__init__(self, name, help, flag=flag, default=default, type="inputdirectory", choices=choices,
required=required, group=group, display_name=display_name, cmd_format=cmd_format, argpos=argpos) required=required, group=group, display_name=display_name, cmd_format=cmd_format, argpos=argpos)
def prepare_input_directory(self, input): def prepare(self, input):
if input == None: if input == None:
return None return None
try: is_local = os.path.isdir(input) return os.path.abspath(input)
except: is_local = False
if not is_local :
jflow_config_reader = JFlowConfigReader()
new_path = os.path.join(jflow_config_reader.get_tmp_directory(), input)
if is_local: new_path = os.path.abspath(input)
return new_path
class AbstractInputFile(AbstractIOFile): class AbstractInputFile(AbstractIOFile):
""" """
...@@ -853,7 +847,7 @@ class InputFile(StrParameter, AbstractInputFile): ...@@ -853,7 +847,7 @@ class InputFile(StrParameter, AbstractInputFile):
else: ctype = self.get_type() else: ctype = self.get_type()
return create_test_function(ctype) return create_test_function(ctype)
def prepare_input_file(self, input): def prepare(self, input):
if input == None: if input == None:
return None return None
# handle url inputs # handle url inputs
...@@ -951,7 +945,7 @@ class InputFileList(ParameterList, AbstractInputFile): ...@@ -951,7 +945,7 @@ class InputFileList(ParameterList, AbstractInputFile):
else: ctype = self.get_type() else: ctype = self.get_type()
return create_test_function(ctype) return create_test_function(ctype)
def prepare_input_files(self, inputs): def prepare(self, inputs):
path2test = _copy.deepcopy(inputs) path2test = _copy.deepcopy(inputs)
new_vals = list() new_vals = list()
if not path2test.__class__.__name__ == "list": if not path2test.__class__.__name__ == "list":
......
...@@ -307,7 +307,7 @@ class Workflow(threading.Thread): ...@@ -307,7 +307,7 @@ class Workflow(threading.Thread):
elif parameter.__class__ == InputFileList: elif parameter.__class__ == InputFileList:
if value == "" : value = [] # from GUI if value == "" : value = [] # from GUI
iovalues = [] iovalues = []
prepared_files = parameter.prepare_input_files(value) prepared_files = parameter.prepare(value)
for file in prepared_files: for file in prepared_files:
iovalues.append(IOFile(file, parameter.file_format, parameter.linkTrace_nameid, None)) 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, new_param = InputFileList( parameter.name, parameter.help, file_format=parameter.file_format, default=iovalues,
...@@ -316,14 +316,14 @@ class Workflow(threading.Thread): ...@@ -316,14 +316,14 @@ class Workflow(threading.Thread):
new_param.linkTrace_nameid = parameter.linkTrace_nameid new_param.linkTrace_nameid = parameter.linkTrace_nameid
elif parameter.__class__ == InputFile: elif parameter.__class__ == InputFile:
if value == "" : value = None # from GUI if value == "" : value = None # from GUI
prepared_file = parameter.prepare_input_file(value) prepared_file = parameter.prepare(value)
new_param = InputFile( parameter.name, parameter.help, file_format=parameter.file_format, default=prepared_file, new_param = InputFile( parameter.name, parameter.help, file_format=parameter.file_format, default=prepared_file,
type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag, type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag,
group=parameter.group, display_name=parameter.display_name ) group=parameter.group, display_name=parameter.display_name )
new_param.linkTrace_nameid = parameter.linkTrace_nameid new_param.linkTrace_nameid = parameter.linkTrace_nameid
elif parameter.__class__ == InputDirectory: elif parameter.__class__ == InputDirectory:
if value == "" : value = None # from GUI if value == "" : value = None # from GUI
prepared_directory = parameter.prepare_input_directory(value) prepared_directory = parameter.prepare(value)
new_param = InputDirectory( parameter.name, parameter.help, default=prepared_directory, choices=parameter.choices, new_param = InputDirectory( parameter.name, parameter.help, default=prepared_directory, choices=parameter.choices,
required=parameter.required, flag=parameter.flag, group=parameter.group, required=parameter.required, flag=parameter.flag, group=parameter.group,
display_name=parameter.display_name ) display_name=parameter.display_name )
......
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