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

Nathan Yergler nathan at yergler.net
Tue Mar 30 08:30:09 EST 2004


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

Modified Files:
      Tag: observable-branch
	observable.py 
Log Message:


Added unsubscribe method to ObservableAdapter




=== Zope3/src/zope/app/observable/observable.py 1.1.2.4 => 1.1.2.5 ===
--- Zope3/src/zope/app/observable/observable.py:1.1.2.4	Mon Mar 29 16:02:57 2004
+++ Zope3/src/zope/app/observable/observable.py	Tue Mar 30 08:30:08 2004
@@ -38,6 +38,14 @@
 
         registry.subscribe(required, provided, subscriber)
 
+    def unsubscribe(self, required, provided, subscriber):
+        annotations = IAnnotations(self.context)
+        registry = annotations.get(key)
+        
+        if registry is not None:
+            # if there is no registry, we can't unsubscribe
+            registry.unsubscribe(required, provided, subscriber)
+        
     def notify(self, event, provided):
         annotations = IAnnotations(self.context)
         registry = annotations.get(key)




More information about the Zope3-Checkins mailing list