Author: bugman Date: Mon Mar 11 12:16:59 2013 New Revision: 18756 URL: http://svn.gna.org/viewcvs/relax?rev=18756&view=rev Log: The generic_fns.mol_res_spin.generate_spin_id_unique() function now handles missing spin containers. Previously if this function was used to generate a spin ID string of a spin not in the data store, it would fail. Now it generates an ID by defaulting to generate_spin_id(). Modified: trunk/generic_fns/mol_res_spin.py Modified: trunk/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/mol_res_spin.py?rev=18756&r1=18755&r2=18756&view=diff ============================================================================== --- trunk/generic_fns/mol_res_spin.py (original) +++ trunk/generic_fns/mol_res_spin.py Mon Mar 11 12:16:59 2013 @@ -1765,12 +1765,12 @@ # Get the containers if needed. if mol == None: mol = return_molecule_by_name(pipe_cont=pipe_cont, mol_name=mol_name) - if res == None: + if mol != None and res == None: if res_name != None or res_num != None: res = return_residue_by_info(mol=mol, res_name=res_name, res_num=res_num) elif len(mol.res) == 1: res = mol.res[0] - if spin == None: + if res != None and spin == None: if spin_name != None or spin_num != None: spin = return_spin_by_info(res=res, spin_name=spin_name, spin_num=spin_num) elif len(res.spin) == 1: