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

No commit message

No commit message
parent 65e6824f
......@@ -48,7 +48,7 @@ def browsefile(file):
def localfile(file):
if os.path.isfile(file):
return os.path.abspath(file)
return file
else:
raise argparse.ArgumentTypeError("File '" + file + "' does not exists! Please provide a valid file path!")
......@@ -814,7 +814,7 @@ class InputFile(StrParameter, AbstractInputFile):
if not is_uri and not is_local and self.type.__name__ == "inputfile" or self.type.__name__ == "browsefile":
jflow_config_reader = JFlowConfigReader()
new_path = os.path.join(jflow_config_reader.get_tmp_directory(), input)
if is_local: new_path = localfile(input)
if is_local: new_path = os.path.abspath(input)
self.check(new_path)
return new_path
......@@ -899,7 +899,7 @@ class InputFileList(ParameterList, AbstractInputFile):
if is_uri: # handle url inputs
new_vals.append(new_url)
elif os.path.isfile(path): # handle localfile
new_vals.append(localfile(path))
new_vals.append(os.path.abspath(path))
else:
try: # handle regexp files
regexpfiles(path)
......@@ -909,7 +909,7 @@ class InputFileList(ParameterList, AbstractInputFile):
folder, pattern = os.path.split(path)
for item in sorted(os.listdir(folder)):
if os.path.isfile(os.path.join(folder, item)) and fnmatch.fnmatch(item, pattern):
new_vals.append( localfile(os.path.join(folder, item)) )
new_vals.append( os.path.abspath(os.path.join(folder, item)) )
except: # handle upload inputs
jflow_config_reader = JFlowConfigReader()
new_vals.append(os.path.join(jflow_config_reader.get_tmp_directory(), path))
......
......@@ -378,10 +378,10 @@ jQuery.validator.addMethod("mparam", function(value, element, params) {
} else if($(this).html() == "server regexp") { // if server regexp files
file_type = "regexpfiles" ;
} else {
if( $("#"+tid).is("input") ){ // single file
file_type = "inputfile" ;
} else { // multiple files
if( $("#"+tid).rules()["mparam"]["action"] == "append" ){ // multiple files
file_type = "inputfiles" ;
} else { // single file
file_type = "inputfile" ;
}
}
// Validate
......@@ -629,7 +629,7 @@ jQuery.validator.addMethod("mparam", function(value, element, params) {
' </div>',
// if param is a regexpfiles
'{{else param.type.indexOf("regexpfiles") === 0}}',
' <input id="${param.name}" name="${param.name}" class="form-control ${param.group}" type="text" value="${param.default}">',
' <textarea id="${param.name}" style="resize:none" name="${param.name}" value="${param.default}" class="list form-control ${param.group}"></textarea>',
// if param is a boolean
'{{else param.type == "bool"}}',
// ' <div class="checkbox-inline">',
......
Supports Markdown
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