mailr7347 - /1.3/generic_fns/structure/api_base.py


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

Header


Content

Posted by edward on September 26, 2008 - 17:15:
Author: bugman
Date: Fri Sep 26 17:15:09 2008
New Revision: 7347

URL: http://svn.gna.org/viewcvs/relax?rev=7347&view=rev
Log:
Wrote the structural object base class method from_xml().


Modified:
    1.3/generic_fns/structure/api_base.py

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=7347&r1=7346&r2=7347&view=diff
==============================================================================
--- 1.3/generic_fns/structure/api_base.py (original)
+++ 1.3/generic_fns/structure/api_base.py Fri Sep 26 17:15:09 2008
@@ -32,7 +32,7 @@
 from types import MethodType
 
 # relax module import.
-from data.relax_xml import fill_object_contents
+from data.relax_xml import fill_object_contents, xml_to_object
 from relax_errors import RelaxImplementError
 
 
@@ -213,6 +213,20 @@
         raise RelaxImplementError
 
 
+    def from_xml(self, str_node):
+        """Recreate the structural object from the XML structural object 
node.
+
+        @param str_node:    The structural object XML node.
+        @type str_node:     xml.dom.minicompat.Element instance
+        """
+
+        # Recreate all the data structures.
+        xml_to_object(str_node, self)
+
+        # Now load the structure from file again.
+        self.load_pdb(file_path=self.file_name, model=None)
+
+
     def load_pdb(self, file_path, model=None, verbosity=False):
         """Prototype method stub for loading structures from a PDB file.
 




Related Messages


Powered by MHonArc, Updated Fri Sep 26 17:40:03 2008