Hi! Products.Five.browser.adding is basically a copy of zope.app.container.browser.adding. Over time they became more out of sync than necessary. I'd like to fix that, but have one question: In the Five version from zope.app import zapi factory = zapi.getUtility(IFactory, type_name) was replaced by import zope.component factory = zope.component.getUtility(IFactory, type_name) (http://svn.zope.org/Products.Five/trunk/browser/adding.py?rev=67820&r1=67728...) Was this a code modernization that should be ported to zope.app.container? Or should I revert the change in Products.Five? Keeping two different versions makes it unnecessarily hard to read the diffs. Personally, I prefer yet an other version: from zope.component import getUtility factory = getUtility(IFactory, type_name) But I don't want to change both files if there is no recommended version. Maybe we don't need a strict policy for this, but some guidance would be nice to have. Any opinions? Any guidelines I missed? Cheers, Yuppie
Hi yuppie
Betreff: [Zope-dev] coding style: using zapi recommended?
[...]
In the Five version
from zope.app import zapi factory = zapi.getUtility(IFactory, type_name)
was replaced by
import zope.component factory = zope.component.getUtility(IFactory, type_name)
Use zope.component and skip dependency to zope.app by using "from zope.app import zapi". Feel free to replace zapi everywhere in all packages if you change something. Regards Roger Ienichen
participants (3)
-
Jim Fulton -
Roger Ineichen -
yuppie