Malthe Borch wrote:
On Z2, certain imports need to come from Products.Five, to play nicely
with ZPublisher and friends.
Not really. You can inherit from zope.publisher.browser.BrowserView and
Five's <browser:page /> directive will magically slap
Acquisition.Explicit into a newly-created subclass that will be
registered as a view.
I'd like to ask for the motivation for not patching it onto the existing
classes and/or modules.
Because monkey-patches are evil. And I won't accept any "buts" here.
They're just evil, hard-to-impossible to test and most important of all,
absolutely unfathomable for the novice developer.
The effect of having Z2-developers import from
Products.Five is that they must opt out on packages that make use of
templates, browser views, formlib, ... --- and it adds needless complexity.
AFAIK, Plone already monkey patches formlib so you won't even have to
change those imports.
This split might also have prompted the Plone community to walk their
own way to the extend that there isn't much code reuse outside of the
core Zope packages (along with egg dependencies, but with our fake eggs,
we're almost up to par here).
I still believe the answer is my Acquisition + __parent__ patch. As
mentionen in this thread already, it's several years old now (yikes!)
but should merge quite cleanly, actually. Zope's own tests pass nicely,
as do the CMF's, only Plone's tests fail in one or two places in an
obscure way (and I'm talking about the whole ploneout testsuite here).
*IF* you'd like to be pragmatic, I'd suggest we clean up those failing
Plone tests, merge the branch and be on our way. Yes, we *might* be
plastering over a potential problem in the patch, but the other 9999
tests didn't seem to be affected and intensive alpha and beta testing of
that new Zope version would likely confirm or refute the existence of a
serious problem. To be honest, my suspicion is that Plone is using some
of the Five stuff in a way that it shouldn't be, hence causing a test
failure with the cleaned up Five. Hanno removed some of the Five-raping
procedures in Plone already, but there might be others lurking around
and causing test failures.
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -