Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(7)  |  Derive(0)  |  Import(2)
Subclass of C{L{Signal}} which wraps its handlers in such a way that garbage-collected
ones are detected instantly.  Clean signals also have a notion of I{parent}, which
they L{prevent from being garbage-collected <notify.gc>}, but only if there is at
least one handler.

Also, unlike plain C{Signal}, C{CleanSignal} allows to weakly reference itself.

src/p/y/py-notify-0.3.1/notify/condition.py   py-notify(Download)
from notify.base   import AbstractValueObject
from notify.gc     import AbstractGCProtector
from notify.signal import CleanSignal
from notify.utils  import execute, is_callable, raise_not_implemented_exception, DummyReference
 
    def _create_signal (self):
        if self.__get_watched_condition () is not None:
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
    def _create_signal (self):
        if self.__negated_condition () is not None:
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
        return signal, weakref.ref (signal, self.__on_usage_change)
 
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
        return signal, weakref.ref (signal, self.__on_usage_change)
 

src/p/y/py-notify-0.3.1/notify/variable.py   py-notify(Download)
from notify.condition import AbstractStateTrackingCondition
from notify.gc        import AbstractGCProtector
from notify.signal    import CleanSignal
from notify.utils     import execute, is_callable, ClassTypes
 
    def _create_signal (self):
        if self.__get_watched_variable () is not None:
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
    def _create_signal (self):
        if self.__variable () is not None:
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)
    def _create_signal (self):
        if self.__variable () is not None:
            AbstractGCProtector.default.protect (self)
 
        signal = CleanSignal (self)