Beispiel #1
0
 def quiet(self, value=True):
     """Control printing of status messages.
     """
     if value:
         # make it quiet
         if self._observers:  # for idempotence
             map(self.unregister, self._observers)
             self._observers = []
     else:
         # make some noise
         if not self._observers:  # for idempotence
             debug = util.kbase_debug_mode()
             self._observers = [LifecyclePrinter(),
                                LifecycleLogger(self.full_name, debug=debug)]
             map(self.register, self._observers)
Beispiel #2
0
 def quiet(self, value=True):
     """Control printing of status messages.
     """
     if value:
         # make it quiet
         if self._observers:  # for idempotence
             map(self.unregister, self._observers)
             self._observers = []
     else:
         # make some noise
         if not self._observers:  # for idempotence
             debug = util.kbase_debug_mode()
             self._observers = [
                 LifecyclePrinter(),
                 LifecycleLogger(self.full_name, debug=debug)
             ]
             map(self.register, self._observers)