mailr16204 - /1.3/status.py


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

Header


Content

Posted by edward on May 10, 2012 - 20:04:
Author: bugman
Date: Thu May 10 20:04:30 2012
New Revision: 16204

URL: http://svn.gna.org/viewcvs/relax?rev=16204&view=rev
Log:
Improved debugging of the observers in the status singleton object.

The Status_container has been renamed to Observer_container and the info() 
method added to print out
everything about the observer objects.  This has to be called in temporary 
debugging code.


Modified:
    1.3/status.py

Modified: 1.3/status.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/status.py?rev=16204&r1=16203&r2=16204&view=diff
==============================================================================
--- 1.3/status.py (original)
+++ 1.3/status.py Thu May 10 20:04:30 2012
@@ -136,7 +136,7 @@
         """Set up all the observer objects."""
 
         # A container for all the observers.
-        self.observers = Status_container()
+        self.observers = Observer_container()
 
         # The observer object for status changes in the auto-analyses.
         self.observers.auto_analyses = Observer('auto_analyses')
@@ -585,7 +585,23 @@
 
 
 
-class Status_container:
-    """The generic empty container for the status data."""
-
-
+class Observer_container:
+    """The container for holding all the observer objects."""
+
+    def info(self):
+        """Print out info about all the status objects."""
+
+        # Blacklisted objects.
+        blacklist = list(self.__class__.__dict__.keys() + 
dict.__dict__.keys())
+
+        # Loop over all objects in this container.
+        for name in dir(self):
+            # Skip blacklisted objects.
+            if name in blacklist:
+                continue
+
+            # Get the object.
+            obj = getattr(self, name)
+
+            # An observer object.
+            print("Observer '%s' keys: %s" % (obj._name, obj._keys))




Related Messages


Powered by MHonArc, Updated Thu May 10 20:20:09 2012