On Nov 15, 2007, at 9:38 PM, Martin Aspeli wrote:

Hi all,

For fun, I just tried to make use of adapters and utilities, registered with ZCML, in a Pylons application.

I installed Pylons in a virtualenv, and easy_installed zope.component and zope.interface using the KGS index for 3.4. I used zope.configuration (also installed) to load a site.zcml, which currently just has:

        <configure xmlns="http://namespaces.zope.org/zope";>
                <include package="zope.component" file="meta.zcml" />
        </configure>

That doesn't work - it complains about not finding zope.security.zcml.

That's because the zope.component.zcml supports specifying permissions on components. The zcml support never should have been added to zope.component. This also illustrates the false promise of extras. The package has zcml support which you expected to be able to use. After all, it is there. To use zcml, you have to specify the zcml extra. This brings the rest of zope with it.

I added the extras myself, despite my dislike of extras, because it was the only way to make zope.component usable without the rest of Zope and without major refactoring and backward incompatibility.

Then I tried to easy_install zope.security, but this pulled in most of Zope, including the ZODB, ZConfig and zdaemon. That's a real shame - no CA (at least not with ZCML) without having pretty much all of Zope there. :(

But you can use the CA without zcml without the rest of Zope. This should not be under appreciated.

I also think extras are a farce. This should not be under appreciated either IMO.

Actually, I never got to try it further, because this then died with:

Installed /Users/optilude/Development/Pylons/zylons/lib/python2.4/ site-packages/ZConfig-2.5-py2.4.egg error: Installed distribution zope.traversing 3.4.0 conflicts with requirement zope.traversing>=3.5.0a1.dev-r78730

Are the Zope eggs ready for prime time? Maybe I should be doing it differently?

Some of them are and some aren't. zope.component will work with just a few packages if you don't use the zcml or persistence support.

I'm curious about how to go about this, since it seems like an incredibly useful thing to be able to do: Make use of the CA in a non-Zope Python application. :)

You can. You just can't use it's zcml support -- which is highly zope specific. Note that there could conceivably be other zcml support that isn't zope specific, but the zcml support in zope.component was moved from zope.app where it really should have stayed.

Jim

--
Jim Fulton
Zope Corporation


_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to