pdk.Util.observer
index
pdk/Util/observer.py

$Id: observer.py,v 1.2 2002/12/17 13:46:38 finell Exp $

Observer-Pattern mixin-class

Subclass those classes (instances) from ToBeOverved that should be overserved by another class. The observing class must have a method called 'update' that is called by the observed class.

 
Modules
            
sys
threading
 
Classes
            
BaseToBeObserved
DictToBeObserved
ToBeObserved
 
class BaseToBeObserved
       
   Methods defined here:
__del__(self)
__init__(self, threadSafe=0, detachOnException=0, maxNumObservers=None)
attach(self, observer, *args)
close(self)
detach(self, observer)
has_observers(self)
is_attached(self, observer)
notify(self, *args, **kw)
notify(*args,**kw): Send all observers an 'update' message. If the special argument 'omitted_observer' is supplied pointing to an observer instance, this one will NOT receive the update message (e.g. to avoid circular change/update messages).
 
class DictToBeObserved(BaseToBeObserved)
     
DictToBeObserved Observer pattern using an internal dictionnary to keep track of observers. Behavious is the same as 'ToBeObserved' implementation.

 
   Methods defined here:
detach_all(self)
get_observer_items()
get_observers(self)
 
class ToBeObserved(BaseToBeObserved)
       
   Methods defined here:
detach_all(self)
get_observers(self)
 
Data
             __author__ = 'Ralph Heinkel'
__revisionn__ = '$Revision: 1.2 $'
__source__ = '$Source: /home/cvs/pdk/pdk/Util/observer.py,v $'
 
Author
            
Ralph Heinkel