[Zope3-checkins] CVS: Zope3/src/zope/app/observable - observable.py:1.1.2.2

Jim Fulton jim at zope.com
Tue Mar 23 16:08:29 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/observable
In directory cvs.zope.org:/tmp/cvs-serv9262/src/zope/app/observable

Modified Files:
      Tag: observable-branch
	observable.py 
Log Message:
Fixed (a little) the implementation of the object adapter registry.

This needs some more thought and testing.


=== Zope3/src/zope/app/observable/observable.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/observable/observable.py:1.1.2.1	Tue Mar 23 15:48:12 2004
+++ Zope3/src/zope/app/observable/observable.py	Tue Mar 23 16:08:29 2004
@@ -36,6 +36,14 @@
     
     def baseFor(self, spec):
         return self.dummybase
+
+    def subscribe(self, required, provided, subscriber):
+        adapters = self.adapters.get(required[0])
+        if not adapters:
+            adapters = self.adapters[required[0]] = {}
+        key = True, tuple(required[1:]), '', provided
+        adapters[key] = adapters.get(key, ()) + (subscriber, )
+        self._p_changed = True
     
 class ObservableAdapter:
 
@@ -54,7 +62,6 @@
         registry.subscribe(required, provided, subscriber)
 
     def notify(self, event, provided):
-        import pdb; pdb.set_trace_doctest()
         annotations = IAnnotations(self.context)
         registry = annotations.get(key)
         




More information about the Zope3-Checkins mailing list