Exemplo n.º 1
0
 def add(self, observer, subject = None):
     observerRef = utils.weakRef(observer)
     if observerRef not in self._list.values():
         observer._collector = utils.weakRef(self)
         self._list[observer._id] = observerRef
         
     if subject:
         dictList = {}
         observer._subject = subject
         if self._dict.has_key(subject):
             dictList = self._dict[subject]
         else:
             self._dict[subject] = dictList
         
         dictList[observer._id] = observerRef
Exemplo n.º 2
0
    def add(self, observer, subject=None):
        observerRef = utils.weakRef(observer)
        if observerRef not in self._list.values():
            observer._collector = utils.weakRef(self)
            self._list[observer._id] = observerRef

        if subject:
            dictList = {}
            observer._subject = subject
            if self._dict.has_key(subject):
                dictList = self._dict[subject]
            else:
                self._dict[subject] = dictList

            dictList[observer._id] = observerRef
Exemplo n.º 3
0
 def setNotificationCallback(self, callback):
     self._notificationCallback = utils.weakRef(callback)
Exemplo n.º 4
0
 def __init__(self):
     self._notificationCallback = utils.weakRef(None)
     self._collector = utils.weakRef(None)
     self._data = {}
     self._id = id(self)
     self._subject = None
    def add(self, observer, attribute):
        attrId = attribute.id()
        ObserverCollector.add(self, observer, attrId)

        self._observedAttributes[attrId] = utils.weakRef(attribute)
        attribute.setValueObserved(True)
Exemplo n.º 6
0
 def setNotificationCallback(self, callback):
     self._notificationCallback = utils.weakRef(callback)
Exemplo n.º 7
0
 def __init__(self):
     self._notificationCallback = utils.weakRef(None)
     self._collector = utils.weakRef(None)
     self._data = {}
     self._id = id(self)
     self._subject = None
 def add(self, observer, attribute):
     attrId = attribute.id()
     ObserverCollector.add(self, observer, attrId)
     
     self._observedAttributes[attrId] = utils.weakRef(attribute)
     attribute.setValueObserved(True)