Chris Withers wrote:

> Hi,
> I was if do something like:
> if zope_version >= 2.3:
>   # balh
> else:
>   # blah
> Where do I get the zope_version bti and what format will it be in?

You can get it as version_txt from Control_Panel. For example, from DTML:

<dtml-with Control_Panel>
  <dtml-var version_txt>

However, this won't do you much good, as when you have a version
of Zope from CVS, it gets called "(unreleased version)".

The way some Products detect the version is to try to import a
module that only exists in one version of Zope, or try to look up
an attribute that is only in one version of Zope, and then catch
the Exception. Ideally, this will be the attribute or module that
has changed that made you want to detect the version in the first

Make your choices based on whether there is an Exception or not.

Steve Alexander
Software Engineer
Cat-Box limited

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to