[Zope3-Users] Registered utility is never found

FB fbo2 at gmx.net
Tue Dec 12 11:36:22 EST 2006


Hi,

On Tue, Dec 12, 2006 at 04:14:31PM +0100, David Johnson wrote:
> 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?

That seems to be ok:

(Pdb) zapi.getAllUtilitiesRegisteredFor(IInitIndicator)
[<fb.init.indicator.InitIndicator object at 0xb6820b6c>, <fb.init.indicator.InitIndicator object at 0xb6a132ec>]
(Pdb)

The first one was created by the <utility>-statement in zcml and should be
superseded by the second one which is persistent in the site manager.

Regards,

Frank


More information about the Zope3-users mailing list