Author: bugman Date: Sun Jun 22 18:13:24 2008 New Revision: 6420 URL: http://svn.gna.org/viewcvs/relax?rev=6420&view=rev Log: Converted the create_hybrid_elem() fn to the PipeContainer.xml_hybrid_elem() method. Modified: 1.3/data/pipe_container.py 1.3/data/relax_xml.py Modified: 1.3/data/pipe_container.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=6420&r1=6419&r2=6420&view=diff ============================================================================== --- 1.3/data/pipe_container.py (original) +++ 1.3/data/pipe_container.py Sun Jun 22 18:13:24 2008 @@ -131,6 +131,31 @@ return True + def xml_hybrid_elem(self, doc, elem): + """Create an XML element for the data pipe hybridisation information. + + @param doc: The XML document object. + @type doc: xml.dom.minidom.Document instance + @param elem: The element to add the hybridisation info to. + @type elem: XML element object + """ + + # Create the hybrid element and add it to the higher level element. + hybrid_elem = doc.createElement('hybrid') + elem.appendChild(hybrid_elem) + + # Set the hybridisation attributes. + hybrid_elem.setAttribute('desc', 'Data pipe hybridisation information') + + # Create an element to store the pipes list. + list_elem = doc.createElement('pipes') + hybrid_elem.appendChild(list_elem) + + # Add the pipes list. + text_val = doc.createTextNode(str(self.hybrid_pipes)) + list_elem.appendChild(text_val) + + def xml_write(self, doc, elem): """Create a XML element for the current data pipe. @@ -147,7 +172,7 @@ fill_object_contents(doc, global_elem, object=self, blacklist=['diff_tensor', 'hybrid_pipes', 'mol', 'pipe_type', 'structure'] + self.__class__.__dict__.keys()) # Hybrid info. - create_hybrid_elem(doc, elem) + self.xml_hybrid_elem(doc, elem) # Add the diffusion tensor data. if hasattr(cdp, 'diff_tensor'): Modified: 1.3/data/relax_xml.py URL: http://svn.gna.org/viewcvs/relax/1.3/data/relax_xml.py?rev=6420&r1=6419&r2=6420&view=diff ============================================================================== --- 1.3/data/relax_xml.py (original) +++ 1.3/data/relax_xml.py Sun Jun 22 18:13:24 2008 @@ -46,31 +46,6 @@ # Add all simple python objects within the PipeContainer to the pipe element. fill_object_contents(doc, tensor_elem, object=ds[ds.current_pipe].diff_tensor, blacklist=['is_empty', 'type']) - - -def create_hybrid_elem(doc, elem): - """Create an XML element for the data pipe hybridisation information. - - @param doc: The XML document object. - @type doc: xml.dom.minidom.Document instance - @param elem: The element to add the hybridisation info to. - @type elem: XML element object - """ - - # Create the hybrid element and add it to the higher level element. - hybrid_elem = doc.createElement('hybrid') - elem.appendChild(hybrid_elem) - - # Set the hybridisation attributes. - hybrid_elem.setAttribute('desc', 'Data pipe hybridisation information') - - # Create an element to store the pipes list. - list_elem = doc.createElement('pipes') - hybrid_elem.appendChild(list_elem) - - # Add the pipes list. - text_val = doc.createTextNode(str(ds[ds.current_pipe].hybrid_pipes)) - list_elem.appendChild(text_val) def create_str_elem(doc, elem):