Author: bugman Date: Sun Oct 1 06:38:42 2006 New Revision: 2593 URL: http://svn.gna.org/viewcvs/relax?rev=2593&view=rev Log: Fix for bug #7241 (https://gna.org/bugs/?7241). This is fix for the changes made at r2591 which were an attempt to fix the bug. Those changes did not work though as the Scientific PDB data structure always contains the objects 'peptide_chains' and 'nucleotide_chains'. Therefore these are now tested to see if they are empty rather than if they exist. The algorithm remains the same as in r2591, peptide chains are searched for and used first, then nucleotide chains are searched for, and if neither are present RelaxNoPdbChainError is raised. Modified: 1.2/generic_fns/pdb.py Modified: 1.2/generic_fns/pdb.py URL: http://svn.gna.org/viewcvs/relax/1.2/generic_fns/pdb.py?rev=2593&r1=2592&r2=2593&view=diff ============================================================================== --- 1.2/generic_fns/pdb.py (original) +++ 1.2/generic_fns/pdb.py Sun Oct 1 06:38:42 2006 @@ -226,9 +226,9 @@ print "\nStructure " + `i + 1` + "\n" # Reassign the first peptide or nucleotide chain of the first structure. - if hasattr(self.relax.data.pdb[self.run].structures[i], 'peptide_chains'): + if self.relax.data.pdb[self.run].structures[i].peptide_chains: pdb_residues = self.relax.data.pdb[self.run].structures[i].peptide_chains[0].residues - elif hasattr(self.relax.data.pdb[self.run].structures[i], 'nucleotide_chains'): + elif self.relax.data.pdb[self.run].structures[i].nucleotide_chains: pdb_residues = self.relax.data.pdb[self.run].structures[i].nucleotide_chains[0].residues else: raise RelaxNoPdbChainError