Commit 1dc1e730 authored by Ibouniyamine Nabihoudine's avatar Ibouniyamine Nabihoudine
Browse files

local directory path

parent 961276a1
......@@ -757,6 +757,17 @@ class InputDirectory(StrParameter, LinkTraceback):
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)
def prepare_input_directory(self, input):
if input == None:
return None
try: is_local = os.path.isdir(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):
"""
@summary : Parent of all InputFile(s) parameters.
......
......@@ -323,7 +323,8 @@ class Workflow(threading.Thread):
new_param.linkTrace_nameid = parameter.linkTrace_nameid
elif parameter.__class__ == InputDirectory:
if value == "" : value = None # from GUI
new_param = InputDirectory( parameter.name, parameter.help, default=value, choices=parameter.choices,
prepared_directory = parameter.prepare_input_directory(value)
new_param = InputDirectory( parameter.name, parameter.help, default=prepared_directory, choices=parameter.choices,
required=parameter.required, flag=parameter.flag, group=parameter.group,
display_name=parameter.display_name )
new_param.linkTrace_nameid = parameter.linkTrace_nameid
......
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