Author: bugman Date: Fri Sep 26 16:49:16 2008 New Revision: 7344 URL: http://svn.gna.org/viewcvs/relax?rev=7344&view=rev Log: Added the code to from_xml() to load the structural data. The from_xml() structural object method needs to be implemented. Modified: 1.3/data/pipe_container.py Modified: 1.3/data/pipe_container.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=7344&r1=7343&r2=7344&view=diff ============================================================================== --- 1.3/data/pipe_container.py (original) +++ 1.3/data/pipe_container.py Fri Sep 26 16:49:16 2008 @@ -139,6 +139,24 @@ mol_nodes = relax_node.getElementsByTagName('mol') self.mol.from_xml(mol_nodes) + # Get the structural object nodes and, if they exist, fill the contents. + str_tensor_nodes = relax_node.getElementsByTagName('structure') + if str_tensor_nodes: + # Get the object type. + parser = str(str_tensor_nodes[0].getAttribute('id')) + + # Create the structural object. + if parser == 'scientific': + self.structure = generic_fns.structure.scientific.Scientific_data() + elif parser == 'intrnal': + self.structure = generic_fns.structure.internal.Internal() + else: + warn(RelaxWarning("The structural file parser " + `parser` + " is unknown. The structure will not be loaded.")) + pass + + # Fill its contents. + self.structure.from_xml(str_tensor_nodes[0]) + def is_empty(self): """Method for testing if the data pipe is empty.