details: http://www.bx.psu.edu/hg/galaxy/rev/88fe7fbd28da changeset: 1698:88fe7fbd28da user: Greg Von Kuster <greg@bx.psu.edu> date: Tue Jan 13 10:34:39 2009 -0500 description: Fix for data source tools that were broken due to the new "outputs_to_working_directory" config setting. Request parameters are now temporarily written to the output dataset if this config setting is either True or False. 1 file(s) affected in this change: lib/galaxy/tools/__init__.py diffs (43 lines): diff -r a6d6c2e4c021 -r 88fe7fbd28da lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py Fri Jan 09 17:18:18 2009 -0500 +++ b/lib/galaxy/tools/__init__.py Tue Jan 13 10:34:39 2009 -0500 @@ -1068,7 +1068,10 @@ wrap_values( input.cases[current].inputs, values ) elif isinstance( input, DataToolParameter ): input_values[ input.name ] = \ - DatasetFilenameWrapper( input_values[ input.name ], datatypes_registry = self.app.datatypes_registry, tool = self, name = input.name ) + DatasetFilenameWrapper( input_values[ input.name ], + datatypes_registry = self.app.datatypes_registry, + tool = self, + name = input.name ) else: input_values[ input.name ] = \ InputValueWrapper( input, input_values[ input.name ], param_dict ) @@ -1085,7 +1088,10 @@ # but this should be considered DEPRECATED, instead use: # $dataset.get_child( 'name' ).filename for name, data in input_datasets.items(): - param_dict[name] = DatasetFilenameWrapper( data, datatypes_registry = self.app.datatypes_registry, tool = self, name = name ) + param_dict[name] = DatasetFilenameWrapper( data, + datatypes_registry = self.app.datatypes_registry, + tool = self, + name = name ) if data: for child in data.children: param_dict[ "_CHILD___%s___%s" % ( name, child.designation ) ] = DatasetFilenameWrapper( child ) @@ -1263,8 +1269,13 @@ if data_type not in app.datatypes_registry.datatypes_by_extension: data_type = 'interval' data = app.datatypes_registry.change_datatype( data, data_type ) - # Store external data source's request parameters temporarily in output file - out = open( data.file_name, 'w' ) + # Store external data source's request parameters temporarily in output file. + # In case the config setting for "outputs_to_working_directory" is True, we must write to + # the DatasetFilenameWrapper object in the param_dict since it's "false_path" attribute + # is the temporary path to the output dataset ( until the job is run ). However, + # even if the "outputs_to_working_directory" setting is False, we can still open the file + # the same way for temporarily storing the request parameters. + out = open( str( param_dict.get( name ) ), 'w' ) for key, value in param_dict.items(): print >> out, '%s\t%s' % ( key, value ) out.close()