Author: bugman Date: Wed May 16 19:02:48 2012 New Revision: 16321 URL: http://svn.gna.org/viewcvs/relax?rev=16321&view=rev Log: The relax data store is_empty() method now only prints to STDERR if the verbosity flag is set. 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=16321&r1=16320&r2=16321&view=diff ============================================================================== --- 1.3/data/__init__.py (original) +++ 1.3/data/__init__.py Wed May 16 19:02:48 2012 @@ -216,16 +216,19 @@ status.observers.pipe_alteration.notify() - def is_empty(self): + def is_empty(self, verbosity=False): """Method for testing if the relax data store is empty. - @return: True if the data store is empty, False otherwise. - @rtype: bool + @keyword verbosity: A flag which if True will cause messages to be printed to STDERR. + @type verbosity: bool + @return: True if the data store is empty, False otherwise. + @rtype: bool """ # No pipes should exist. if not self.keys() == []: - stderr.write("The relax data store contains the data pipes %s.\n" % self.keys()) + if verbosity: + stderr.write("The relax data store contains the data pipes %s.\n" % self.keys()) return False # Objects which should be in here. @@ -252,7 +255,8 @@ continue # An object has been added. - stderr.write("The relax data store contains the object %s.\n" % name) + if verbosity: + stderr.write("The relax data store contains the object %s.\n" % name) return False # The data store is empty.