mailr15790 - /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 April 23, 2012 - 09:08:
Author: bugman
Date: Mon Apr 23 09:08:25 2012
New Revision: 15790

URL: http://svn.gna.org/viewcvs/relax?rev=15790&view=rev
Log:
The ds.relax_gui GUI data object is now a permanent feature of the relax data 
store.

This is in preparation for attempting the almost impossible task of making 
the GUI tests work within
the GUI!


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=15790&r1=15789&r2=15790&view=diff
==============================================================================
--- 1.3/data/__init__.py (original)
+++ 1.3/data/__init__.py Mon Apr 23 09:08:25 2012
@@ -69,7 +69,11 @@
 
         # First initialisation.
         if self.instance is None:
+            # Create a new instance.
             self.instance = dict.__new__(self, *args, **kargs)
+
+            # Add some initial structures.
+            self.instance.relax_gui = Gui()
 
         # Already initialised, so return the instance.
         return self.instance
@@ -171,6 +175,9 @@
         # Reset the current data pipe.
         __builtin__.cdp = None
 
+        # Re-add the GUI object.
+        self.instance.relax_gui = Gui()
+
         # Signal the change.
         status.observers.reset.notify()
         status.observers.pipe_alteration.notify()
@@ -221,6 +228,11 @@
             stderr.write("The relax data store contains the data pipes 
%s.\n" % self.keys())
             return False
 
+        # Objects which should be in here.
+        blacklist = [
+                'relax_gui'
+        ]
+
         # An object has been added to the data store.
         for name in dir(self):
             # Skip the data store methods.
@@ -233,6 +245,10 @@
 
             # Skip special objects.
             if search("^__", name):
+                continue
+
+            # Blacklisted objects to skip.
+            if name in blacklist:
                 continue
 
             # An object has been added.
@@ -280,10 +296,6 @@
         # Get the GUI nodes.
         gui_nodes = relax_node.getElementsByTagName('relax_gui')
         if gui_nodes:
-            # Create the GUI object.
-            self.relax_gui = Gui()
-
-            # Fill its contents.
             self.relax_gui.from_xml(gui_nodes[0])
 
         # Recreate all the data store data structures.




Related Messages


Powered by MHonArc, Updated Mon Apr 23 09:40:01 2012