[Zope-CMF] Re: Checking which version of the CMF is running
Charlie Clark
charlie at begeistert.org
Fri Oct 13 12:10:28 EDT 2006
Am 13.10.2006 um 17:29 schrieb Tres Seaver:
>
> That should work. However, I think I would rather do "capability
> checks" than "version checks", e.g.::
>
> try:
> from Products.CMFCore.permissions import AddPortalContent
> except ImportError: # BBB, CMF < 1.5
> from Products.CMFCore.CMFCorePermissions import AddPortalContent
I agree with this in general but still think there should be a
general way of checking the version of a Product just like Zope has
getZopeVersion() because that might help work out where to import
from. I was just surprised by the way it was done in this particular
module which if I read Formulator.__init__.py shouldn't even get
imported in CMFCore is around and then I looked at the Plone
installer which does it's own file system search, ie. I realise this
isn't a CMF issue but thought which version of the CMF is running
might be important to a lot of things out there.
Should I punt this to the zope-dev lot? Simply factoring out the
version checking code from App.Product.initialize_product() should do
the trick.
Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226
More information about the Zope-CMF
mailing list