Author: bugman Date: Thu Jan 15 10:27:18 2009 New Revision: 8456 URL: http://svn.gna.org/viewcvs/relax?rev=8456&view=rev Log: Added checks for the presence of the molecular data structures in the Scientific python structure. Modified: branches/multi_structure/generic_fns/structure/scientific.py Modified: branches/multi_structure/generic_fns/structure/scientific.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/scientific.py?rev=8456&r1=8455&r2=8456&view=diff ============================================================================== --- branches/multi_structure/generic_fns/structure/scientific.py (original) +++ branches/multi_structure/generic_fns/structure/scientific.py Thu Jan 15 10:27:18 2009 @@ -609,22 +609,25 @@ print model # First add the peptide chains (generating the molecule names and incrementing the molecule index). - for mol in model.peptide_chains: - mol_conts[-1].append(mol) - self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) - mol_index = mol_index + 1 + if hasattr(model, 'peptide_chains'): + for mol in model.peptide_chains: + mol_conts[-1].append(mol) + self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) + mol_index = mol_index + 1 # Then the nucleotide chains (generating the molecule names and incrementing the molecule index). - for mol in model.nucleotide_chains: - mol_conts[-1].append(mol) - self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) - mol_index = mol_index + 1 + if hasattr(model, 'nucleotide_chains'): + for mol in model.nucleotide_chains: + mol_conts[-1].append(mol) + self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) + mol_index = mol_index + 1 # Finally all other molecules (generating the molecule names and incrementing the molecule index). - for key in model.molecules.keys(): - mol_conts[-1].append(model.molecules[key]) - self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) - mol_index = mol_index + 1 + if hasattr(model, 'molecules'): + for key in model.molecules.keys(): + mol_conts[-1].append(model.molecules[key]) + self.target_mol_name(set=set_mol_name, target=new_mol_name, index=mol_index, mol_num=mol_index+1, file=file) + mol_index = mol_index + 1 # Increment the model counter. model_num = model_num + 1