Author: bugman Date: Wed Jan 27 20:45:40 2010 New Revision: 10454 URL: http://svn.gna.org/viewcvs/relax?rev=10454&view=rev Log: Created the Gui.from_xml() method to specifically recreate the ds.relax_gui base object. Modified: branches/bieri_gui/data/gui.py Modified: branches/bieri_gui/data/gui.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/data/gui.py?rev=10454&r1=10453&r2=10454&view=diff ============================================================================== --- branches/bieri_gui/data/gui.py (original) +++ branches/bieri_gui/data/gui.py Wed Jan 27 20:45:40 2010 @@ -25,6 +25,7 @@ # relax module imports. from data_classes import Element, RelaxListType +from relax_xml import xml_to_object class Gui(Element): @@ -42,6 +43,26 @@ # Set the name and description. self.name = 'relax_gui' self.desc = 'The relax GUI information store.' + + + def from_xml(self, gui_node): + """Recreate the element data structure from the XML element node. + + @param gui_node: The element XML node. + @type gui_node: xml.dom.minicompat.Element instance + """ + + # Add the analysis list object. + self.analyses = Analyses() + + # Get the analyses node. + analyses_nodes = gui_node.getElementsByTagName('analyses') + + # Recreate the analyses structure. + self.analyses.from_xml(analyses_nodes) + + # Recreate all the other data structures. + xml_to_object(gui_node, self, blacklist=['analyses'])