mailr6422 - in /1.3/data: diff_tensor.py relax_xml.py


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

Header


Content

Posted by edward on June 22, 2008 - 18:21:
Author: bugman
Date: Sun Jun 22 18:21:03 2008
New Revision: 6422

URL: http://svn.gna.org/viewcvs/relax?rev=6422&view=rev
Log:
Shifted the create_diff_elem() fn to the DiffTensorData class.


Modified:
    1.3/data/diff_tensor.py
    1.3/data/relax_xml.py

Modified: 1.3/data/diff_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/diff_tensor.py?rev=6422&r1=6421&r2=6422&view=diff
==============================================================================
--- 1.3/data/diff_tensor.py (original)
+++ 1.3/data/diff_tensor.py Sun Jun 22 18:21:03 2008
@@ -29,6 +29,7 @@
 # relax module imports.
 from data_classes import Element
 from relax_errors import RelaxError
+from relax_xml import fill_object_contents
 
 
 
@@ -825,6 +826,27 @@
                     self.__dict__[target+'_sim'] = DiffTensorSimList(target, 
self)
 
 
+    def xml_create_diff_element(self, doc, element):
+        """Create an XML element for the diffusion tensor.
+
+        @param doc:     The XML document object.
+        @type doc:      xml.dom.minidom.Document instance
+        @param element:    The element to add the diffusion tensor element 
to.
+        @type element:     XML element object
+        """
+
+        # Create the diffusion tensor element and add it to the higher level 
element.
+        tensor_element = doc.createElement('diff_tensor')
+        element.appendChild(tensor_element)
+
+        # Set the diffusion tensor attributes.
+        tensor_element.setAttribute('desc', 'Diffusion tensor')
+        tensor_element.setAttribute('type', self.type)
+
+        # Add all simple python objects within the PipeContainer to the pipe 
element.
+        fill_object_contents(doc, tensor_element, object=self, 
blacklist=self.__class__.__dict__.keys())
+
+
 
 class DiffTensorSimList(ListType):
     """Empty data container for Monte Carlo simulation diffusion tensor 
data."""

Modified: 1.3/data/relax_xml.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/relax_xml.py?rev=6422&r1=6421&r2=6422&view=diff
==============================================================================
--- 1.3/data/relax_xml.py (original)
+++ 1.3/data/relax_xml.py Sun Jun 22 18:21:03 2008
@@ -25,27 +25,6 @@
 
 # Python module imports.
 from re import search
-
-
-def create_diff_elem(doc, elem):
-    """Create an XML element for the diffusion tensor.
-
-    @param doc:     The XML document object.
-    @type doc:      xml.dom.minidom.Document instance
-    @param elem:    The element to add the diffusion tensor element to.
-    @type elem:     XML element object
-    """
-
-    # Create the diffusion tensor element and add it to the higher level 
element.
-    tensor_elem = doc.createElement('diff_tensor')
-    elem.appendChild(tensor_elem)
-
-    # Set the diffusion tensor attributes.
-    tensor_elem.setAttribute('desc', 'Diffusion tensor')
-    tensor_elem.setAttribute('type', ds[ds.current_pipe].diff_tensor.type)
-
-    # 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_str_elem(doc, elem):




Related Messages


Powered by MHonArc, Updated Sun Jun 22 18:40:09 2008