[Zope3-checkins] SVN: Zope3/trunk/ implement IPersistent to
LocalUtilityService
Dominik Huber
dominik.huber at projekt01.ch
Wed Dec 1 02:39:52 EST 2004
Log message for revision 28544:
implement IPersistent to LocalUtilityService
to prevent intid utility errors during registration
and unregistration of local utility services.
Changed:
U Zope3/trunk/doc/CHANGES.txt
U Zope3/trunk/src/zope/app/intid/tests.py
U Zope3/trunk/src/zope/app/utility/utility.py
-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt 2004-11-30 22:33:58 UTC (rev 28543)
+++ Zope3/trunk/doc/CHANGES.txt 2004-12-01 07:39:52 UTC (rev 28544)
@@ -197,6 +197,10 @@
Bug Fixes
+ - Fixed intid utility: Registration and unregistration of
+ local utitlity services, context aware registration of nested
+ components that may provide their own intids utiltities.
+
- Fixed browser:defaultView metaconfigure: for_ passes a GlobalObject
and not a Token of GlobalObjects.
Modified: Zope3/trunk/src/zope/app/intid/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/intid/tests.py 2004-11-30 22:33:58 UTC (rev 28543)
+++ Zope3/trunk/src/zope/app/intid/tests.py 2004-12-01 07:39:52 UTC (rev 28544)
@@ -210,7 +210,10 @@
self.assertEquals(events[0].original_event.object, parent_folder)
self.assertEquals(events[0].object, folder)
- def test_localutilityservice_bug(self):
+ def test_addIntIdSubscriber_and_localutilityservice(self):
+ # Their was a bug caused when a local utility service was
+ # registered within a intid utility
+
# setup first some stuff
from zope.app.intid import addIntIdSubscriber
from zope.app.container.contained import ObjectAddedEvent
@@ -225,18 +228,7 @@
utils = LocalUtilityService()
utils.__parent__ = folder # cheat IConnection adapter
- # try to register the local utility sevice
- self.assertRaises(TypeError, addIntIdSubscriber, utils, ObjectAddedEvent(parent_folder))
-
- # problem: local utility sevice does not provide IPersistent
- # -> LocalUtilityService implementsOnly(ILocalUtilityService, ISimpleService, IBindingAware)
- self.assertEquals(False, IPersistent.providedBy(utils))
-
- # add IPersistent to utils
- from zope.interface import directlyProvides, directlyProvidedBy
- directlyProvides(utils, IPersistent, directlyProvidedBy(utils))
-
- # try another time...
+ # register utils
addIntIdSubscriber(utils, ObjectAddedEvent(parent_folder))
# check that the utilis got registered
Modified: Zope3/trunk/src/zope/app/utility/utility.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/utility.py 2004-11-30 22:33:58 UTC (rev 28543)
+++ Zope3/trunk/src/zope/app/utility/utility.py 2004-12-01 07:39:52 UTC (rev 28544)
@@ -16,7 +16,7 @@
$Id$
"""
-
+from persistent.interfaces import IPersistent
from zope.app.adapter.adapter import LocalAdapterService
from zope.app import zapi
from zope.app.registration.registration import ComponentRegistration
@@ -38,6 +38,7 @@
ILocalUtilityService,
zope.app.site.interfaces.ISimpleService,
zope.app.site.interfaces.IBindingAware,
+ IPersistent # used for IKeyReference adaption
)
More information about the Zope3-Checkins
mailing list