Author: bugman Date: Tue Jun 11 18:54:25 2013 New Revision: 20049 URL: http://svn.gna.org/viewcvs/relax?rev=20049&view=rev Log: Completed the fix for bug #20889 (https://gna.org/bugs/?20889). The problem was that the spectrum.read_intensities user function was incorrectly updating the cdp.spectrum_ids list when the spectrum_id argument is set to a list. The list of IDs was being set as a single element of cdp.spectrum_ids, causing problems with the GUI when updating the ComboBox choices and then subsequent setting of the spectrum IDs. This bug and fix is independent of the relax_disp branch, despite being uncovered there and being caught by the Relax_disp.test_bug_20889_multi_col_peak_list GUI test in that branch. Modified: trunk/pipe_control/spectrum.py Modified: trunk/pipe_control/spectrum.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/spectrum.py?rev=20049&r1=20048&r2=20049&view=diff ============================================================================== --- trunk/pipe_control/spectrum.py (original) +++ trunk/pipe_control/spectrum.py Tue Jun 11 18:54:25 2013 @@ -560,7 +560,7 @@ @keyword dir: The directory where the file is located. @type dir: str @keyword spectrum_id: The spectrum identification string. - @type spectrum_id: str + @type spectrum_id: str or list of str @keyword heteronuc: The name of the heteronucleus as specified in the peak intensity file. @type heteronuc: str @keyword proton: The name of the proton as specified in the peak intensity file. @@ -684,14 +684,18 @@ intensity_data[i][2] = spin_id # Add the spectrum id (and ncproc) to the relax data store. + spectrum_ids = spectrum_id + if isinstance(spectrum_id, str): + spectrum_ids = [spectrum_id] if not hasattr(cdp, 'spectrum_ids'): cdp.spectrum_ids = [] if ncproc != None: cdp.ncproc = {} - if not spectrum_id in cdp.spectrum_ids: - cdp.spectrum_ids.append(spectrum_id) - if ncproc != None: - cdp.ncproc[spectrum_id] = ncproc + for i in range(len(spectrum_ids)): + if not spectrum_ids[i] in cdp.spectrum_ids: + cdp.spectrum_ids.append(spectrum_ids[i]) + if ncproc != None: + cdp.ncproc[spectrum_ids[i]] = ncproc # Loop over the peak intensity data. data = []