Author: bugman Date: Thu Apr 24 14:31:14 2014 New Revision: 22845 URL: http://svn.gna.org/viewcvs/relax?rev=22845&view=rev Log: Fixes for the specific API _set_param_values_spin() method for lists and dictionaries. This is for the value.set user function to allow it to handle parameters of different types. For example the 'R2' parameter in the relaxation dispersion analysis. This API common method now sets all dictionary elements, list elements, or the variable to the given value. Modified: trunk/specific_analyses/api_common.py Modified: trunk/specific_analyses/api_common.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/api_common.py?rev=22845&r1=22844&r2=22845&view=diff ============================================================================== --- trunk/specific_analyses/api_common.py (original) +++ trunk/specific_analyses/api_common.py Thu Apr 24 14:31:14 2014 @@ -569,7 +569,17 @@ obj_name += '_err' # Set the parameter. - setattr(spin, obj_name, value[i]) + param_type = self._PARAMS.type(param[i]) + if param_type == dict: + obj = getattr(spin, obj_name) + for key in obj: + obj[key] = value[i] + elif param_type == list: + obj = getattr(spin, obj_name) + for j in range(len(obj)): + obj[j] = value[i] + else: + setattr(spin, obj_name, value[i]) def _set_selected_sim_global(self, model_info, select_sim):