[hg] galaxy 3481: Update default tool action execute() method to...
details: http://www.bx.psu.edu/hg/galaxy/rev/2e025a8d71d0 changeset: 3481:2e025a8d71d0 user: Dan Blankenberg <dan@bx.psu.edu> date: Thu Mar 04 13:19:14 2010 -0500 description: Update default tool action execute() method to only wrap incoming values once per call. It was previously wrapping once per output data label generated and for each change_format tag. diffstat: lib/galaxy/tools/actions/__init__.py | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diffs (44 lines): diff -r 39aac31a841b -r 2e025a8d71d0 lib/galaxy/tools/actions/__init__.py --- a/lib/galaxy/tools/actions/__init__.py Thu Mar 04 13:10:09 2010 -0500 +++ b/lib/galaxy/tools/actions/__init__.py Thu Mar 04 13:19:14 2010 -0500 @@ -182,6 +182,7 @@ on_text = "" # Add the dbkey to the incoming parameters incoming[ "dbkey" ] = input_dbkey + params = None #wrapped params are used by change_format action and by output.label; only perform this wrapping once, as needed # Keep track of parent / child relationships, we'll create all the # datasets first, then create the associations parent_to_child_pairs = [] @@ -213,8 +214,9 @@ ext = input_ext #process change_format tags if output.change_format: - params = make_dict_copy( incoming ) #FIXME: The wrapping of inputs should only be done once per call to execute; currently happens here and possibly when generating output dataset name - wrap_values( tool.inputs, params ) + if params is None: + params = make_dict_copy( incoming ) + wrap_values( tool.inputs, params ) for change_elem in output.change_format: for when_elem in change_elem.findall( 'when' ): check = when_elem.get( 'input', None ) @@ -258,12 +260,14 @@ data.blurb = "queued" # Set output label if output.label: - params = make_dict_copy( incoming ) - # wrapping the params allows the tool config to contain things like - # <outputs> - # <data format="input" name="output" label="Blat on ${<input_param>.name}" /> - # </outputs> - wrap_values( tool.inputs, params ) + if params is None: + params = make_dict_copy( incoming ) + # wrapping the params allows the tool config to contain things like + # <outputs> + # <data format="input" name="output" label="Blat on ${<input_param>.name}" /> + # </outputs> + wrap_values( tool.inputs, params ) + #tool (only needing to be set once) and on_string (set differently for each label) are overwritten for each output dataset label being determined params['tool'] = tool params['on_string'] = on_text data.name = fill_template( output.label, context=params )
participants (1)
-
Greg Von Kuster