[Zope3-Users] Re: register and unregister Utility

Jürgen Kartnaller juergen at kartnaller.at
Wed Dec 27 15:42:55 EST 2006



Florian Lindner wrote:
> Am Mittwoch, 27. Dezember 2006 19:15 schrieb Jürgen Kartnaller:
>> component.provideUtility for a global utility.
> 
> I've found that.
> 
>> See zope.component.interfaces.IComponentRegistrationConvenience
> 
> Ok, for registering. But what to call for unregistering? (I have a global 
> utility)

zope.component.getGlobalRegistry() implements IComponentRegistry

> 
>> Or for local utilities registered in a site manager you use the site
>> manager :
>>
>> sm.registerUtility
>> sm.unregisterUtility
>>
>> See zope.component.interfaces.IComponentRegistry
> 
> Ok, there is the unregisterUtility function. Where do I get an object 
> implementing this interface?

sm = site.getSiteManager()

> 
> Thanks,
> 
> Florian
> 
>> Jürgen
>>
>> Florian Lindner wrote:
>>> Hello,
>>> easy question but I just don't finde the approbiate function. How to
>>> register and unregister programmatically an utility?
>>>
>>> Thanks,
>>>
>>> Florian
>> _______________________________________________
>> Zope3-users mailing list
>> Zope3-users at zope.org
>> http://mail.zope.org/mailman/listinfo/zope3-users



More information about the Zope3-users mailing list