Exemple #1
0
class Observable(object):
    '''
    Definition of an observable class
    '''

    def __init__(self, observer = None):
        if not observer is None:
            self.observer = observer
        else:
            self.observer = AccumulativeObserver()
    
    def notify(self, action, message):
        self.observer.notify(self.__class__.__name__, action, message)
Exemple #2
0
class Observable(object):
    """
    Definition of an observable class
    """

    def __init__(self, observer = None):
        if not observer is None:
            self.observer = observer
        else:
            self.observer = AccumulativeObserver()

    def notify(self, action, message):
        self.observer.notify(self.__class__.__name__, action, message)
Exemple #3
0
 def __init__(self, observer = None):
     if not observer is None:
         self.observer = observer
     else:
         self.observer = AccumulativeObserver()
Exemple #4
0
 def __init__(self, observer = None):
     if not observer is None:
         self.observer = observer
     else:
         self.observer = AccumulativeObserver()