(self, filter: ListenerFilter = None)
return unsubd
Clears list of subscribed listeners. If filter is given, it must
        be a function that takes a listener and returns true if the listener
        should be unsubscribed. Returns the list of Listener for listeners
        that were unsubscribed.
Clears list of subscribed listeners. If filter is given, it must
        be a function that takes a listener and returns true if the listener
        should be unsubscribed. Returns the list of Listener for listeners
        that were unsubscribed.
Clears list of subscribed listeners . If filter is given it must be a function that takes a listener and returns true if the listener should be unsubscribed . Returns the list of Listener for listeners that were unsubscribed .
def unsubscribeAllListeners(self, filter: ListenerFilter = None) -> List[Listener]:
        """
        Clears list of subscribed listeners. If filter is given, it must
        be a function that takes a listener and returns true if the listener
        should be unsubscribed. Returns the list of Listener for listeners
        that were unsubscribed.
        """
        unsubd = []
        if filter is None:
            for listener in self.__listeners:
                listener._unlinkFromTopic_()
            unsubd = self.__listeners.keys()
            self.__listeners = {}
        else:
            unsubd = []
            for listener in list(self.__listeners):
                if filter(listener):
                    unsubd.append(listener)
                    listener._unlinkFromTopic_()
                    del self.__listeners[listener]

        # send notification regarding all listeners actually unsubscribed
        notificationMgr = self._treeConfig.notificationMgr
        for unsubdLisnr in unsubd:
            notificationMgr.notifyUnsubscribe(unsubdLisnr, self)

        return unsubd
def unsubscribeAllListeners ( self , filter : ListenerFilter = None ) -> List [ Listener ] : unsubd = [ ] if filter is None : for listener in self . __listeners : listener . _unlinkFromTopic_ ( ) unsubd = self . __listeners . keys ( ) self . __listeners = { } else : unsubd = [ ] for listener in list ( self . __listeners ) : if filter ( listener ) : unsubd . append ( listener ) listener . _unlinkFromTopic_ ( ) del self . __listeners [ listener ] # send notification regarding all listeners actually unsubscribed notificationMgr = self . _treeConfig . notificationMgr for unsubdLisnr in unsubd : notificationMgr . notifyUnsubscribe ( unsubdLisnr , self ) return unsubd