mailr11534 - /1.3/generic_fns/structure/main.py


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

Header


Content

Posted by edward on September 06, 2010 - 11:04:
Author: bugman
Date: Mon Sep  6 11:04:48 2010
New Revision: 11534

URL: http://svn.gna.org/viewcvs/relax?rev=11534&view=rev
Log:
The structure.load_spins() user function now gives a RelaxWarning if no data 
could be found.


Modified:
    1.3/generic_fns/structure/main.py

Modified: 1.3/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=11534&r1=11533&r2=11534&view=diff
==============================================================================
--- 1.3/generic_fns/structure/main.py (original)
+++ 1.3/generic_fns/structure/main.py Mon Sep  6 11:04:48 2010
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2009 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2010 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -271,6 +271,11 @@
                 spin_cont.pos = []
             spin_cont.pos.append(pos)
         spin_cont.element = element
+
+    # Catch no data.
+    if len(mol_names) == 0:
+        warn(RelaxWarning("No spins matching the '%s' ID string could be 
found." % spin_id))
+        return
 
     # Print out.
     write_spin_data(file=sys.stdout, mol_names=mol_names, res_nums=res_nums, 
res_names=res_names, spin_nums=spin_nums, spin_names=spin_names)




Related Messages


Powered by MHonArc, Updated Thu Sep 09 02:40:02 2010