Merge branch 'release_16.04' into release_16.07

This commit is contained in:
Nicola Soranzo
2016-08-18 15:49:30 +01:00
5 changed files with 48 additions and 2 deletions
+1 -1
View File
@@ -620,7 +620,7 @@ class DefaultToolAction( object ):
"""
if output.actions:
for action in output.actions.actions:
if action.tag == "metadata":
if action.tag == "metadata" and action.default:
metadata_new_value = fill_template( action.default, context=params ).split(",")
dataset.metadata.__setattr__(str(action.name), metadata_new_value)
+9
View File
@@ -1,7 +1,16 @@
"""Entry point for the usage of Cheetah templating within Galaxy."""
from Cheetah.Template import Template
def fill_template( template_text, context=None, **kwargs ):
"""Fill a cheetah template out for specified context.
If template_text is None, an exception will be thrown, if context
is None (the default) - keyword arguments to this function will be used
as the context.
"""
if template_text is None:
raise TypeError("Template text specified as None to fill_template.")
if not context:
context = kwargs
return str( Template( source=template_text, searchList=[context] ) )
+1 -1
View File
@@ -34,7 +34,7 @@ do
shift
;;
--daemon|--restart|restart)
if [ "$1"=="--restart" ]
if [ "$1" == "--restart" ]
then
paster_args="$paster_args restart"
else
@@ -0,0 +1,36 @@
<tool id="dbkey_output_action" name="dbkey_output_action" version="0.1.0">
<command>echo foo > $mapped_reads</command>
<inputs>
<param name="input" type="data" />
<param name="index" type="select" label="Using reference genome">
<options from_data_table="test_fasta_indexes">
<filter type="data_meta" ref="input" key="dbkey" column="1" />
<validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
</options>
</param>
</inputs>
<outputs>
<data format="txt" name="mapped_reads">
<actions>
<action type="metadata" name="dbkey">
<option type="from_data_table" name="test_fasta_indexes" column="1" offset="0">
<filter type="param_value" column="0" value="#" compare="startswith" keep="False"/>
<filter type="param_value" ref="index" column="0"/>
</option>
</action>
</actions>
</data>
</outputs>
<tests>
<test>
<param name="input" value="simple_line.txt" dbkey="hg18" />
<param name="index" value="hg18"/>
<output name="mapped_reads">
<metadata name="dbkey" value="hg18" />
<assert_contents>
<has_text text="foo" />
</assert_contents>
</output>
</test>
</tests>
</tool>
@@ -18,6 +18,7 @@
<tool file="inputs_as_json.xml" />
<tool file="dbkey_filter_input.xml" />
<tool file="dbkey_filter_multi_input.xml" />
<tool file="dbkey_output_action.xml" />
<tool file="composite_output.xml" />
<tool file="composite_output_tests.xml" />
<tool file="unicode_stream.xml" />