mailr8610 - /branches/multi_structure/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 January 22, 2009 - 17:04:
Author: bugman
Date: Thu Jan 22 17:04:19 2009
New Revision: 8610

URL: http://svn.gna.org/viewcvs/relax?rev=8610&view=rev
Log:
The MolContainer instances are now being properly recreated.


Modified:
    branches/multi_structure/generic_fns/structure/api_base.py

Modified: branches/multi_structure/generic_fns/structure/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/api_base.py?rev=8610&r1=8609&r2=8610&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/api_base.py (original)
+++ branches/multi_structure/generic_fns/structure/api_base.py Thu Jan 22 
17:04:19 2009
@@ -971,13 +971,25 @@
         if not self.is_empty():
             raise RelaxFromXMLNotEmptyError, self.__class__.__name__
 
+        # Some imports (here to break circular import issues).
+        from internal import Internal
+        from scientific import Scientific
+
         # Loop over the molecules.
         for mol_node in mol_nodes:
-            # Get the molecule details and add the molecule to the MolList 
structure.
+            # Initialise a MolContainer instance.
+            if id == 'internal':
+                mol_cont = Internal()
+            elif id == 'scientific':
+                mol_cont = Scientific()
+
+            # Get the molecule name.
             name = mol_node.getAttribute('name')
             if name == 'None':
                 name = None
-            self.add_item(mol_name=name)
+
+            # Add the molecule to the MolList structure.
+            self.add_item(mol_name=name, mol_cont=mol_cont)
 
             # Execute the specific MolContainer from_xml() method.
             self[-1].from_xml(mol_node)




Related Messages


Powered by MHonArc, Updated Thu Jan 22 17:20:02 2009