Author: bugman Date: Fri Sep 26 15:59:34 2008 New Revision: 7341 URL: http://svn.gna.org/viewcvs/relax?rev=7341&view=rev Log: Shifted the pipe container xml_create_str_element() method to the to_xml() structural object method. Modified: 1.3/data/pipe_container.py 1.3/generic_fns/structure/api_base.py Modified: 1.3/data/pipe_container.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=7341&r1=7340&r2=7341&view=diff ============================================================================== --- 1.3/data/pipe_container.py (original) +++ 1.3/data/pipe_container.py Fri Sep 26 15:59:34 2008 @@ -208,7 +208,7 @@ # Add the structural data, if it exists. if hasattr(self, 'structure'): - self.xml_create_str_element(doc, element) + self.structure.to_xml(doc, element) # Add the molecule-residue-spin data. self.mol.to_xml(doc, element) @@ -237,21 +237,3 @@ # Add the pipes list. text_val = doc.createTextNode(str(self.hybrid_pipes)) list_element.appendChild(text_val) - - - def xml_create_str_element(self, doc, element): - """Create an XML element for the structural information. - - @param doc: The XML document object. - @type doc: xml.dom.minidom.Document instance - @param element: The element to add the structural info to. - @type element: XML element object - """ - - # Create the structural element and add it to the higher level element. - str_element = doc.createElement('structure') - element.appendChild(str_element) - - # Set the structural attributes. - str_element.setAttribute('desc', 'Structural information') - str_element.setAttribute('id', self.structure.id) Modified: 1.3/generic_fns/structure/api_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/api_base.py?rev=7341&r1=7340&r2=7341&view=diff ============================================================================== --- 1.3/generic_fns/structure/api_base.py (original) +++ 1.3/generic_fns/structure/api_base.py Fri Sep 26 15:59:34 2008 @@ -238,6 +238,24 @@ return len(self.structural_data) + def to_xml(self, doc, element): + """Prototype method for converting the structural object to an XML representation. + + @param doc: The XML document object. + @type doc: xml.dom.minidom.Document instance + @param element: The element to add the alignment tensors XML element to. + @type element: XML element object + """ + + # Create the structural element and add it to the higher level element. + str_element = doc.createElement('structure') + element.appendChild(str_element) + + # Set the structural attributes. + str_element.setAttribute('desc', 'Structural information') + str_element.setAttribute('id', self.id) + + def write_pdb(self, file, struct_index=None): """Prototype method stub for the creation of a PDB file from the structural data.