[Zope3-Users] Registered utility is never found

David Johnson djohnson at jsatech.com
Tue Dec 12 10:14:31 EST 2006


Try:
--
utils = zapi.getAllUtilitiesRegisteredFor(IYourInterface)
for util in utils:
     print util
--

You can list all the returned utilities. See if your utility is returned,  
and see what name it is registered under. If not, try with a known  
interface.  Can you provide the results here?







On Tue, 12 Dec 2006 15:29:55 +0100, Garanin Michael <garanin at m-lan.ru>  
wrote:

> FB wrote:
>> On Tue, Dec 12, 2006 at 04:42:56PM +0300, Garanin Michael wrote:
>>
>>> traceback, please.
>>>
>>
>> Hmm ... how? It just doesn't return the utility as expected (it returns
>> None). There is no error shown in any way.
>>
>>
>
> from APIDOC:
> """
>
>     * *|getUtility(interface, name='', context=None)| *
>
>       .....         If one is not found, raises
>       ComponentLookupError.               <==== must be EXCEPTION !!!
>
>
> """
>
> There are not "ComponenLookupError" exception? Why you find bug in  
> "getUtility"? ;-)
>
>
> (sorry my english)
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Zope3-users mailing list