Author: bugman Date: Thu Nov 22 17:25:44 2007 New Revision: 3823 URL: http://svn.gna.org/viewcvs/relax?rev=3823&view=rev Log: Fix for the generic_fns.sequence.read() function.
Modified: 1.3/generic_fns/sequence.py Modified: 1.3/generic_fns/sequence.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/sequence.py?rev=3823&r1=3822&r2=3823&view=diff ============================================================================== --- 1.3/generic_fns/sequence.py (original) +++ 1.3/generic_fns/sequence.py Thu Nov 22 17:25:44 2007 @@ -40,12 +40,23 @@ # Count the number of header lines. header_lines = 0 for i in xrange(len(file_data)): - try: - int(file_data[i][num_col]) - except: - header_lines = header_lines + 1 - else: - break + # Residue number. + if res_num_col != None: + try: + int(file_data[i][res_num_col]) + except ValueError: + header_lines = header_lines + 1 + else: + break + + # Spin number. + elif spin_num_col != None: + try: + int(file_data[i][spin_num_col]) + except ValueError: + header_lines = header_lines + 1 + else: + break # Remove the header. file_data = file_data[header_lines:] _______________________________________________ relax (http://nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits