[Zope] checking Zope's version number

Martijn Pieters mj@digicool.com
Wed, 13 Sep 2000 10:56:36 +0200


On Tue, Sep 12, 2000 at 09:49:46PM -0700, Hung Jung Lu wrote:
> Is there a way of detecting Zope's version number? (I know there is an 
> environment variable REQUEST.environ['SERVER_SOFTWARE'], but is there a 
> better/standard way of accessing Zope's version number?)
> 
> (I seem to have problem using the context.registerHelp() in a product's 
> __init__ method under Zope 2.1.6.)

Use version_txt:

  from App.version_txt import version_txt
  version_string = version_txt()

In CVS versions of Zope this will return '(unreleased version)' though.

You could also test for the existence of registerHelp:

  if hasattr(context, 'registerHelp'):
      context.registerHelp()

-- 
Martijn Pieters
| Software Engineer            mailto:mj@digicool.com
| Digital Creations          http://www.digicool.com/
| Creators of Zope               http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-----------------------------------------------------