mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Change the pass_as_file XML attribute to a cheetah method call, and apply to all paramter types that can have Multiple=True set - those given in DatasetListWrappers and DatasetCollectionWrappers. Test case and modification suggestion provided by John Chilton <jmchilton@gmail.com>
38 lines
1.1 KiB
XML
38 lines
1.1 KiB
XML
<tool id="paths_as_file" name="paths_as_file" version="0.1.0">
|
|
<configfiles>
|
|
<configfile name="check_paths_file"><![CDATA[
|
|
import sys
|
|
paths_file = sys.argv[1]
|
|
sep = sys.argv[2]
|
|
if sep == "NEWLINE":
|
|
sep = "\n"
|
|
with open(paths_file, "r") as f:
|
|
paths = f.read()
|
|
assert paths == sep.join(sys.argv[3:])
|
|
]]></configfile>
|
|
</configfiles>
|
|
<command detect_errors="exit_code"><![CDATA[
|
|
python $check_paths_file $inputs.paths_as_file NEWLINE #for $f in $inputs# ${f} #end for#
|
|
&&
|
|
python $check_paths_file $inputs.paths_as_file(sep=',') ',' #for $f in $inputs# ${f} #end for#
|
|
&&
|
|
printf 'All Done' > $out1
|
|
]]></command>
|
|
<inputs>
|
|
<param name="inputs" type="data" format="txt" multiple="true" label="Data 1" />
|
|
</inputs>
|
|
<outputs>
|
|
<data format="txt" name="out1" />
|
|
</outputs>
|
|
<tests>
|
|
<test>
|
|
<param name="inputs" value="simple_line.txt,simple_line_alternative.txt" />
|
|
<output name="out1">
|
|
<assert_contents>
|
|
<has_line line="All Done" />
|
|
</assert_contents>
|
|
</output>
|
|
</test>
|
|
</tests>
|
|
</tool>
|