Re: [Zope] checking Zope's version number

2000-09-13 Thread Martijn Pieters

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 Engineermailto:[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]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] checking Zope's version number

2000-09-13 Thread Hung Jung Lu

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()

Ahh... very cool. Thanks.

Hung Jung
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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