[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/observable/ Merged
my fixes to zope.app.observable, r27673 through r27679,
to the trunk.
Philipp von Weitershausen
philikon at philikon.de
Fri Sep 24 14:13:55 EDT 2004
Log message for revision 27680:
Merged my fixes to zope.app.observable, r27673 through r27679, to the trunk.
Changed:
U Zope3/trunk/src/zope/app/observable/README.txt
U Zope3/trunk/src/zope/app/observable/configure.zcml
A Zope3/trunk/src/zope/app/observable/ftests.py
A Zope3/trunk/src/zope/app/observable/observable.txt
U Zope3/trunk/src/zope/app/observable/observers.py
U Zope3/trunk/src/zope/app/observable/tests.py
-=-
Modified: Zope3/trunk/src/zope/app/observable/README.txt
===================================================================
--- Zope3/trunk/src/zope/app/observable/README.txt 2004-09-24 18:11:25 UTC (rev 27679)
+++ Zope3/trunk/src/zope/app/observable/README.txt 2004-09-24 18:13:54 UTC (rev 27680)
@@ -7,7 +7,7 @@
http://dev.zope.org/Zope3/InstanceAndTypeBasedSubscriptions .
The package provides an event channel for dispatching events to the
-appropriate instance as well as an adapter from IAnnotatable to
+appropriate instance as well as an adapter from `IAnnotatable` to
`IObservable`. This is important because an object must support
`IAnnotatable` (and therefore `IAnnotations`) in order to support
instance-based subscriptions.
Modified: Zope3/trunk/src/zope/app/observable/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/observable/configure.zcml 2004-09-24 18:11:25 UTC (rev 27679)
+++ Zope3/trunk/src/zope/app/observable/configure.zcml 2004-09-24 18:13:54 UTC (rev 27680)
@@ -1,8 +1,14 @@
<configure xmlns="http://namespaces.zope.org/zope">
-<subscriber
- factory=".observerevent.observerEventNotifier"
- for="zope.app.event.interfaces.IObjectEvent"
- />
+ <adapter
+ for="zope.app.annotation.interfaces.IAnnotatable"
+ provides="zope.app.observable.interfaces.IObservable"
+ factory=".observable.ObservableAdapter"
+ />
+ <subscriber
+ factory=".observerevent.observerEventNotifier"
+ for="zope.app.event.interfaces.IObjectEvent"
+ />
+
</configure>
Copied: Zope3/trunk/src/zope/app/observable/ftests.py (from rev 27679, Zope3/branches/ZopeX3-3.0/src/zope/app/observable/ftests.py)
Copied: Zope3/trunk/src/zope/app/observable/observable.txt (from rev 27679, Zope3/branches/ZopeX3-3.0/src/zope/app/observable/observable.txt)
Modified: Zope3/trunk/src/zope/app/observable/observers.py
===================================================================
--- Zope3/trunk/src/zope/app/observable/observers.py 2004-09-24 18:11:25 UTC (rev 27679)
+++ Zope3/trunk/src/zope/app/observable/observers.py 2004-09-24 18:13:54 UTC (rev 27680)
@@ -121,7 +121,7 @@
"""
def __init__(self, spec, registry):
- Surrogate.__init__(self, spec, registry)
+ super(LocalSurrogate, self).__init__(spec, registry)
self.registry = registry
def clean(self):
@@ -135,26 +135,32 @@
)
else:
self.adapters = {}
+ super(LocalSurrogate, self).clean()
- Surrogate.clean(self)
-
class Observers(AdapterRegistry, Persistent):
"""Local/persistent surrogate registry
"""
-
_surrogateClass = LocalSurrogate
def __init__(self):
self.adapters = {}
- AdapterRegistry.__init__(self)
+ super(Observers, self).__init__()
def __getstate__(self):
state = Persistent.__getstate__(self).copy()
- del state['_surrogates']
+
+ # set by AdapterRegistry.__init__
del state['_default']
del state['_null']
- del state['_remove']
+
+ # the following attributes are instance methods that
+ # AdapterRegistry.__init__ took from its AdapterLookup
+ # instance
+ for key in ('lookup', 'lookup1', 'queryAdapter', 'get',
+ 'adapter_hook', 'subscriptions',
+ 'queryMultiAdapter', 'subscribers'):
+ del state[key]
return state
def __setstate__(self, state):
Modified: Zope3/trunk/src/zope/app/observable/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/observable/tests.py 2004-09-24 18:11:25 UTC (rev 27679)
+++ Zope3/trunk/src/zope/app/observable/tests.py 2004-09-24 18:13:54 UTC (rev 27680)
@@ -164,7 +164,6 @@
"""
def test_suite():
- import sys
return unittest.TestSuite((
doctest.DocTestSuite(),
doctest.DocTestSuite('zope.app.observable.observers'),
@@ -172,4 +171,3 @@
if __name__ == '__main__':
test_suite()
-
More information about the Zope3-Checkins
mailing list