mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #16542 from davelopez/23.1_fix_multiple_remote_test_data
[23.1] Fix `multiple` remote test data
This commit is contained in:
@@ -864,6 +864,9 @@ def __parse_param_elem(param_elem, i=0):
|
||||
else:
|
||||
value = None
|
||||
|
||||
if value is None and attrib.get("location", None) is not None:
|
||||
value = os.path.basename(attrib["location"])
|
||||
|
||||
children_elem = param_elem
|
||||
if children_elem is not None:
|
||||
# At this time, we can assume having children only
|
||||
|
||||
@@ -183,16 +183,25 @@ def _process_raw_inputs(
|
||||
param_value = raw_input_dict["value"]
|
||||
param_extra = raw_input_dict["attributes"]
|
||||
location = param_extra.get("location")
|
||||
if param_value is None and location:
|
||||
# If no value is given, we try to get the file name directly from the URL
|
||||
param_value = os.path.basename(location)
|
||||
if not value.type == "text":
|
||||
param_value = _split_if_str(param_value)
|
||||
if isinstance(value, galaxy.tools.parameters.basic.DataToolParameter):
|
||||
if not isinstance(param_value, list):
|
||||
param_value = [param_value]
|
||||
for v in param_value:
|
||||
_add_uploaded_dataset(context.for_state(), v, param_extra, value, required_files)
|
||||
if location and value.multiple:
|
||||
# We get the input/s from the location which can be a list of urls separated by commas
|
||||
locations = _split_if_str(location)
|
||||
param_value = []
|
||||
for location in locations:
|
||||
v = os.path.basename(location)
|
||||
param_value.append(v)
|
||||
# param_extra should contain only the corresponding location
|
||||
extra = dict(param_extra)
|
||||
extra["location"] = location
|
||||
_add_uploaded_dataset(context.for_state(), v, extra, value, required_files)
|
||||
else:
|
||||
if not isinstance(param_value, list):
|
||||
param_value = [param_value]
|
||||
for v in param_value:
|
||||
_add_uploaded_dataset(context.for_state(), v, param_extra, value, required_files)
|
||||
processed_value = param_value
|
||||
elif isinstance(value, galaxy.tools.parameters.basic.DataCollectionToolParameter):
|
||||
assert "collection" in param_extra
|
||||
|
||||
Reference in New Issue
Block a user