def notify_observers(self, signal, **kwargs):
        """ Notify observers of a given signal.

        Parameters
        ----------
        signal : str
            a valid signal.
        kwargs : dict
            the parameters that will be sent to the observers.

        Returns
        -------
        out: bool
            False if a notification is in progress, otherwise True.

        """

        # Check if a notification if in progress
        if self._locked:
            return False
        # Set the lock
        self._locked = True

        # Create a signal object
        signal_to_be_notified = SignalObject()
        setattr(signal_to_be_notified, "object", self)
        setattr(signal_to_be_notified, "signal", signal)
        for name, value in kwargs.items():
            setattr(signal_to_be_notified, name, value)
        # Notify all the observers
        for observer in self._observers[signal]:
            observer(signal_to_be_notified)
        # Unlock the notification process
        self._locked = False
def notify_observers ( self , signal , ** kwargs ) : if self . _locked : return False self . _locked = True signal_to_be_notified = SignalObject ( ) setattr ( signal_to_be_notified , "object" , self ) setattr ( signal_to_be_notified , "signal" , signal ) for name , value in kwargs . items ( ) : setattr ( signal_to_be_notified , name , value ) for observer in self . _observers [ signal ] : observer ( signal_to_be_notified ) self . _locked = False
Notify observers of a given signal.

        Parameters
        ----------
        signal : str
            a valid signal.
        kwargs : dict
            the parameters that will be sent to the observers.

        Returns
        -------
        out: bool
            False if a notification is in progress, otherwise True.