Author: bugman Date: Fri Nov 21 18:36:43 2008 New Revision: 8015 URL: http://svn.gna.org/viewcvs/relax?rev=8015&view=rev Log: Merged revisions 8014 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r8014 | bugman | 2008-11-21 18:35:42 +0100 (Fri, 21 Nov 2008) | 3 lines The structure.load_spins() user function now tests if a structure has been loaded. ........ Modified: branches/j_couplings/ (props changed) branches/j_couplings/generic_fns/structure/main.py Propchange: branches/j_couplings/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Nov 21 18:36:43 2008 @@ -1,1 +1,1 @@ -/1.3:1-8010 +/1.3:1-8014 Modified: branches/j_couplings/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/j_couplings/generic_fns/structure/main.py?rev=8015&r1=8014&r2=8015&view=diff ============================================================================== --- branches/j_couplings/generic_fns/structure/main.py (original) +++ branches/j_couplings/generic_fns/structure/main.py Fri Nov 21 18:36:43 2008 @@ -57,12 +57,16 @@ # Test if the current data pipe exists. pipes.test() + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Test if the structure exists. + if not hasattr(cdp, 'structure') or not cdp.structure.num > 0: + raise RelaxNoPdbError + # Print out. print "Adding the following spins to the relax data store.\n" write_header(sys.stdout, mol_name_flag=True, res_num_flag=True, res_name_flag=True, spin_num_flag=True, spin_name_flag=True) - - # Alias the current data pipe. - cdp = pipes.get_pipe() # Loop over all atoms of the spin_id selection. for mol_name, res_num, res_name, atom_num, atom_name, element, pos in cdp.structure.atom_loop(atom_id=spin_id, str_id=str_id, mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_num_flag=True, atom_name_flag=True, element_flag=True, pos_flag=True, ave=ave_pos):