mailr6493 - /1.3/data/__init__.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 25, 2008 - 02:17:
Author: bugman
Date: Wed Jun 25 02:17:44 2008
New Revision: 6493

URL: http://svn.gna.org/viewcvs/relax?rev=6493&view=rev
Log:
Removed the unnecessary dependence on the xml.dom.ext package.

Instead the xml.dom.minidom.Document method toprettyxml() will be used 
instead.


Modified:
    1.3/data/__init__.py

Modified: 1.3/data/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/__init__.py?rev=6493&r1=6492&r2=6493&view=diff
==============================================================================
--- 1.3/data/__init__.py (original)
+++ 1.3/data/__init__.py Wed Jun 25 02:17:44 2008
@@ -28,7 +28,6 @@
 from re import search
 from string import split
 from time import asctime
-import xml.dom.ext
 import xml.dom.minidom
 
 # relax module imports.
@@ -184,20 +183,20 @@
         """
 
         # Create the XML document object.
-        xmldoc = xml.dom.minidom.Document()
+        self.xmldoc = xml.dom.minidom.Document()
 
         # Create the top level element, including the relax URL.
-        top_element = xmldoc.createElementNS('http://nmr-relax.com', 'relax')
+        top_element = self.xmldoc.createElementNS('http://nmr-relax.com', 
'relax')
 
         # Append the element.
-        xmldoc.appendChild(top_element)
+        self.xmldoc.appendChild(top_element)
 
         # Set the relax version number, and add a creation time.
         top_element.setAttribute('version', version)
         top_element.setAttribute('time', asctime())
 
         # Create the pipe XML element and add it to the top level XML 
element.
-        pipe_element = xmldoc.createElement('pipe')
+        pipe_element = self.xmldoc.createElement('pipe')
         top_element.appendChild(pipe_element)
 
         # Set the data pipe attributes.
@@ -206,7 +205,7 @@
         pipe_element.setAttribute('type', self[self.current_pipe].pipe_type)
 
         # Fill the data pipe XML element.
-        self[self.current_pipe].xml_create_pipe_element(xmldoc, pipe_element)
+        self[self.current_pipe].xml_create_pipe_element(self.xmldoc, 
pipe_element)
 
         # Write out the XML file.
-        xml.dom.ext.PrettyPrint(xmldoc, file)
+        file.write(self.xmldoc.toprettyxml())




Related Messages


Powered by MHonArc, Updated Wed Jun 25 02:20:13 2008