[Zope3-Users] [Zope3.0] How to unregister an utility?
Andreas Jung
lists at zopyx.com
Sat Jun 9 06:42:34 EDT 2007
--On 9. Juni 2007 14:17:14 +0530 Shailesh Kumar <shaileshk at gmail.com> wrote:
> from zope.component.globalregistry import getGlobalSiteManager
> gsm = getGlobalSiteManager()
> gsm.unregisterUtility(component=None, provided=None, name=u'')
>
This won't work with Zope 2.8, however the following code works:
+ from zope.component.servicenames import Utilities
+ from zope.app import zapi
+ s = zapi.getGlobalServices().getService(Utilities)
+ s.register((), ISQLAlchemyWrapper, self.util_id, None)
Unfortunately this code does not work with Zope 2.9 and the related code
for Zope 2.10 also does not work with Zope 2.9 :-)
In-CA-we-trust,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20070609/09b415e5/attachment.bin
More information about the Zope3-users
mailing list