Exemple #1
0
 def handle_disconnect (self, source):
     """
     Handles the disconnection from the source removing any weak
     reference from it.
     """
     self._sources = remove_if (lambda x : x () == source, self._sources)
     super (Trackable, self).handle_disconnect (source)
Exemple #2
0
 def handle_disconnect(self, source):
     """
     Handles the disconnection from the source removing any weak
     reference from it.
     """
     self._sources = remove_if(lambda x: x() == source, self._sources)
     super(Trackable, self).handle_disconnect(source)
Exemple #3
0
    def disconnect_if(self, predicate):
        """
        Disconnects all the sources that satisfy 'predicate', being
        'predicate' a boolean function over the destiny objects.
        """
        def pred(dest):
            if predicate(dest):
                dest.handle_disconnect(self)
                return True
            return False

        self._destinies = remove_if(pred, self._destinies)
Exemple #4
0
 def disconnect_if (self, predicate):
     """
     Disconnects all the sources that satisfy 'predicate', being
     'predicate' a boolean function over the destiny objects.
     """
     
     def pred (dest):
         if predicate (dest):
             dest.handle_disconnect (self)
             return True
         return False
     
     self._destinies = remove_if (pred, self._destinies)