mailRe: r21817 - /trunk/lib/spectrum/nmrpipe.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on December 06, 2013 - 11:22:
Hi Troels,

The raise statement cannot be used here at all.  It is only for
raising errors, and a warning is not an error.  For errors you use
'raise' but for warnings you use 'warn()' instead.  Also note that for
the formatting of warnings and errors in the relax UIs, you will need
to remove the newline character '\n'.  This will otherwise cause
strange behaviour with the colouring in the prompt or the detection of
errors and warnings by the relax controller in the GUI.

Cheers,

Edward




On 6 December 2013 11:09,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Fri Dec  6 11:09:17 2013
New Revision: 21817

URL: http://svn.gna.org/viewcvs/relax?rev=21817&view=rev
Log:
Fix for issuing a warning in reading spins from a NMRPipe SeriesTab 
formatted file.

Work in progress for Support Request #3044, 
(https://gna.org/support/index.php?3044) - Load spins from SPARKY list.

Modified:
    trunk/lib/spectrum/nmrpipe.py

Modified: trunk/lib/spectrum/nmrpipe.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/spectrum/nmrpipe.py?rev=21817&r1=21816&r2=21817&view=diff
==============================================================================
--- trunk/lib/spectrum/nmrpipe.py (original)
+++ trunk/lib/spectrum/nmrpipe.py Fri Dec  6 11:09:17 2013
@@ -25,10 +25,12 @@

 # Python module imports.
 import re
+from warnings import warn

 # relax module imports.
 from lib.errors import RelaxError
 from lib.io import open_write_file, strip
+from lib.warnings import RelaxWarning


 def read_seriestab(peak_list=None, file_data=None, int_col=None):
@@ -118,14 +120,14 @@
         try:
             res_name1 = row1[-4]
         except:
-            raise RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the assignment '%s' for residue name dimension 
1.\nSetting residue name to None." % line[0])
+            raise warn(RelaxWarning("Improperly formatted NMRPipe 
SeriesTab file, cannot process the assignment '%s' for residue name 
dimension 1.\nSetting residue name to None." % line[0]))
             res_name1 = None

         # The residue name for dimension 2.
         try:
             res_name2 = row2[-4]
         except:
-            raise RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the assignment '%s' for residue name dimension 
2.\nSetting residue name to None." % line[0])
+            raise warn(RelaxWarning("Improperly formatted NMRPipe 
SeriesTab file, cannot process the assignment '%s' for residue name 
dimension 2.\nSetting residue name to None." % line[0]))
             res_name2 = None

         # Get the intensities.


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

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



Related Messages


Powered by MHonArc, Updated Fri Dec 06 11:40:08 2013