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'):

Martijn Pieters
| Software Engineer            mailto:[EMAIL PROTECTED]
| Digital Creations          http://www.digicool.com/
| Creators of Zope               http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to