Tom Gross wrote:
you are trying to lookup the utility with the name None. If you
don't specify a name when registering the utility,
omit the second parameter: zapi.getUtility(IInitIndicator)
In other words, the name of an unnamed utility isn't None, but the empty
string.
--
Benji York
Se
Hi Frank,
you are trying to lookup the utility with the name None. If you
don't specify a name when registering the utility,
omit the second parameter: zapi.getUtility(IInitIndicator)
Cheers
-Tom
FB wrote:
On Tue, Dec 12, 2006 at 05:29:55PM +0300, Garanin Michael wrote:
FB wrote:
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
> registe
On Tue, Dec 12, 2006 at 05:29:55PM +0300, Garanin Michael 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
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?
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)|
On Tue, Dec 12, 2006 at 04:42:56PM +0300, Garanin Michael wrote:
> FB wrote:
> >Hi,
> >
> >is there any reason why a registered utility which is persistently stored
> >inside the site
> >manager is never found via zapi.getUtility(IMyInterface) ?
> >
> >More information:
> >
> >I wrote a package (
FB wrote:
Hi,
is there any reason why a registered utility which is persistently stored
inside the site
manager is never found via zapi.getUtility(IMyInterface) ?
More information:
I wrote a package ( fb ) containing some components making the developer's life
easier. The package
provides a
Hi,
On Tue, Dec 12, 2006 at 01:54:01PM +0100, Tom Gross wrote:
> Hi Frank,
>
>is your InitIndicator-instance implementing the
> IInitIndicatorFB-interface. This is absolutely
> necessary
> for providing it as an utility. There's an easy test for this:
>
> >>> from zope.interface.verify imp
Hi Frank,
is your InitIndicator-instance implementing the
IInitIndicatorFB-interface. This is absolutely necessary
for providing it as an utility. There's an easy test for this:
>>> from zope.interface.verify import verifyObject
>>> ii = InitIndicator()
>>> verifyObject(IInitIndicatorFB, ii
Hi,
On Tue, Dec 12, 2006 at 07:56:53AM +1100, Tom Dossis wrote:
> FB wrote:
> > Hi,
> >
> > is there any reason why a registered utility which is persistently stored
> > inside the site
> > manager is never found via zapi.getUtility(IMyInterface) ?
> >
> > More information:
> >
> > I wrote a p
Hi,
On Mon, Dec 11, 2006 at 11:41:25PM +0100, David Johnson wrote:
> >Hi,
> >
> >is there any reason why a registered utility which is persistently stored
> >inside the site
> >manager is never found via zapi.getUtility(IMyInterface) ?
> It's been my experience this is caused by registering with
12 matches
Mail list logo