Пример #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)
Пример #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)
Пример #3
0
 def __init__(self, observer = None):
     if not observer is None:
         self.observer = observer
     else:
         self.observer = AccumulativeObserver()
Пример #4
0
 def __init__(self, observer = None):
     if not observer is None:
         self.observer = observer
     else:
         self.observer = AccumulativeObserver()