1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/1e3d92ec22b2/ Changeset: 1e3d92ec22b2 User: dan Date: 2013-04-22 22:58:49 Summary: Have data source tools display the provided 'name' parameter as the initial dataset name. Affected #: 3 files diff -r ea0b7ca55aec1552718132227d80b0ae82ca2913 -r 1e3d92ec22b2794bfa2294edb74695c580791406 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -36,6 +36,7 @@ from galaxy.datatypes.metadata import JobExternalOutputMetadataWrapper from galaxy.jobs import ParallelismInfo from galaxy.tools.actions import DefaultToolAction +from galaxy.tools.actions.data_source import DataSourceToolAction from galaxy.tools.actions.data_manager import DataManagerToolAction from galaxy.tools.deps import DependencyManager from galaxy.tools.parameters import check_param, params_from_strings, params_to_strings @@ -3028,6 +3029,7 @@ allow the user to query and extract data from another web site. """ tool_type = 'data_source' + default_tool_action = DataSourceToolAction def _build_GALAXY_URL_parameter( self ): return ToolParameter.build( self, ElementTree.XML( '<param name="GALAXY_URL" type="baseurl" value="/tool_runner?tool_id=%s" />' % self.id ) ) diff -r ea0b7ca55aec1552718132227d80b0ae82ca2913 -r 1e3d92ec22b2794bfa2294edb74695c580791406 lib/galaxy/tools/actions/__init__.py --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -342,9 +342,10 @@ params['on_string'] = on_text data.name = fill_template( output.label, context=params ) else: - data.name = tool.name - if on_text: - data.name += ( " on " + on_text ) + if params is None: + params = make_dict_copy( incoming ) + wrap_values( tool.inputs, params, skip_missing_values = not tool.check_values ) + data.name = self._get_default_data_name( data, tool, on_text=on_text, trans=trans, incoming=incoming, history=history, params=params, job_params=job_params ) # Store output out_data[ name ] = data if output.actions: @@ -430,3 +431,9 @@ trans.app.job_queue.put( job.id, job.tool_id ) trans.log_event( "Added job to the job queue, id: %s" % str(job.id), tool_id=job.tool_id ) return job, out_data + + def _get_default_data_name( self, dataset, tool, on_text=None, trans=None, incoming=None, history=None, params=None, job_params=None, **kwd ): + name = tool.name + if on_text: + name += ( " on " + on_text ) + return name diff -r ea0b7ca55aec1552718132227d80b0ae82ca2913 -r 1e3d92ec22b2794bfa2294edb74695c580791406 lib/galaxy/tools/actions/data_source.py --- /dev/null +++ b/lib/galaxy/tools/actions/data_source.py @@ -0,0 +1,12 @@ +from __init__ import DefaultToolAction + +import logging +log = logging.getLogger( __name__ ) + +class DataSourceToolAction( DefaultToolAction ): + """Tool action used for Data Source Tools""" + + def _get_default_data_name( self, dataset, tool, on_text=None, trans=None, incoming=None, history=None, params=None, job_params=None, **kwd ): + if incoming and 'name' in incoming: + return incoming[ 'name' ] + return super( DataSourceToolAction, self )._get_default_data_name( dataset, tool, on_text=on_text, trans=trans, incoming=incoming, history=history, params=params, job_params=job_params ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.