Author: bugman Date: Wed Apr 9 11:05:36 2008 New Revision: 5478 URL: http://svn.gna.org/viewcvs/relax?rev=5478&view=rev Log: Created the ResidueList.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=5478&r1=5477&r2=5478&view=diff ============================================================================== --- 1.3/data/mol_res_spin.py (original) +++ 1.3/data/mol_res_spin.py Wed Apr 9 11:05:36 2008 @@ -310,6 +310,22 @@ self.append(ResidueContainer(res_name, res_num, select)) + def is_empty(self): + """Method for testing if this ResidueList object is empty. + + @return: True if this list only has one ResidueContainer and the residue number and name + have not been set, False otherwise. + @rtype: bool + """ + + # There is only one ResidueContainer and it is empty. + if len(self) == 1 and self[0].is_empty(): + return True + + # Otherwise. + return False + + # The molecule data. ###################