Author: bugman Date: Wed Apr 9 11:19:37 2008 New Revision: 5486 URL: http://svn.gna.org/viewcvs/relax?rev=5486&view=rev Log: Created the MoleculeList.is_empty() method. Modified: 1.3/data/mol_res_spin.py Modified: 1.3/data/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/mol_res_spin.py?rev=5486&r1=5485&r2=5486&view=diff ============================================================================== --- 1.3/data/mol_res_spin.py (original) +++ 1.3/data/mol_res_spin.py Wed Apr 9 11:19:37 2008 @@ -455,3 +455,19 @@ # Otherwise append an empty MoleculeContainer. else: self.append(MoleculeContainer(mol_name, select)) + + + def is_empty(self): + """Method for testing if this MoleculeList object is empty. + + @return: True if this list only has one MoleculeContainer and the molecule name has not + been set, False otherwise. + @rtype: bool + """ + + # There is only one MoleculeContainer and it is empty. + if len(self) == 1 and self[0].is_empty(): + return True + + # Otherwise. + return False