Author: bugman Date: Thu May 10 20:05:04 2012 New Revision: 16205 URL: http://svn.gna.org/viewcvs/relax?rev=16205&view=rev Log: Merged revisions 16203-16204 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r16203 | bugman | 2012-05-10 20:01:40 +0200 (Thu, 10 May 2012) | 3 lines Debugging print out fix. ........ r16204 | bugman | 2012-05-10 20:04:30 +0200 (Thu, 10 May 2012) | 6 lines 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: branches/uf_redesign/ (props changed) branches/uf_redesign/status.py Propchange: branches/uf_redesign/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu May 10 20:05:04 2012 @@ -1,1 +1,1 @@ -/1.3:1-16147 +/1.3:1-16204 Modified: branches/uf_redesign/status.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/status.py?rev=16205&r1=16204&r2=16205&view=diff ============================================================================== --- branches/uf_redesign/status.py (original) +++ branches/uf_redesign/status.py Thu May 10 20:05:04 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') @@ -482,7 +482,7 @@ # Does not exist, so return (allow multiple code paths to unregister methods). if key not in self._keys: if self._status.debug: - sys.stdout.write("debug> The key '%s' does not exist." % key) + sys.stdout.write("debug> The key '%s' does not exist.\n" % key) return # Remove the method from the dictionary of callbacks. @@ -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))