Re: [Zope3-dev] getUtilitiesFor() fools me

2005-05-02 Thread Andreas Jung
Martijn Faasen helped me meanwhile to resolve this issue. The problem was 
that the Python package
was sitting directly in the Products/ directory instead of 
Products//src directory..this
caused obviously the confusion of the interface matching machinery.

Andreas
--On Montag, 2. Mai 2005 18:42 Uhr +0200 Dominik Huber 
<[EMAIL PROTECTED]> wrote:

Andreas Jung wrote:
Hi,
I restructured the TXNG 3 source so that the core implementation can
be used as package (within Zope 2.8/Five)
...so far so good.
The configure.zcml under Products/TextIndexNG3 contains several
statements of the form:
 
Inside a browser view class there is the following method:
   def get_converters(self):
   """ return all available converters """
   from zope.app import zapi
   from textindexng.interfaces import IConverter
   print [x for x in zapi.getUtilitiesFor(IConverter)]
   return zapi.getUtilitiesFor(IConverter)

But the getUtilitiesFor() call always returns nothing. In my case
textindexng/interfaces contains several files with interfaces and all
interfaces are aliased in interfaces/__init__.py. The "textindexng"
package itself lives unter Products/TextIndexNG3 and sys.path is
extended in Products/TextIndexNG3/__init__.py to be able to import
the "textindexng" package without the need to use "Products.TextIndexNG3"
in importsso any ideas why the utility machinery refuses to
return the registered utilities for the given interface? A
Did you include the configure.zcml by a file (for example
textindexng-configure.zcml) within zope3/package-includes folder?
content of textindexng-configure.zcml

Regards,
Dominik Huber




pgp4e0ZkE9JsW.pgp
Description: PGP signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] getUtilitiesFor() fools me

2005-05-02 Thread Andreas Jung
Hi,
I restructured the TXNG 3 source so that the core implementation can be 
used as package (within Zope 2.8/Five)
...so far so good.

The configure.zcml under Products/TextIndexNG3 contains several statements 
of the form:

 
Inside a browser view class there is the following method:
   def get_converters(self):
   """ return all available converters """
   from zope.app import zapi
   from textindexng.interfaces import IConverter
   print [x for x in zapi.getUtilitiesFor(IConverter)]
   return zapi.getUtilitiesFor(IConverter)

But the getUtilitiesFor() call always returns nothing. In my case
textindexng/interfaces contains several files with interfaces and all
interfaces are aliased in interfaces/__init__.py. The "textindexng"
package itself lives unter Products/TextIndexNG3 and sys.path is
extended in Products/TextIndexNG3/__init__.py to be able to import
the "textindexng" package without the need to use "Products.TextIndexNG3"
in importsso any ideas why the utility machinery refuses to
return the registered utilities for the given interface? A
Andreas


pgppEgVgAzNmB.pgp
Description: PGP signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com