[Zope-Checkins] CVS: Zope2 - version_txt.py:1.3
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Mon, 11 Jun 2001 10:50:05 -0400
Update of /cvs-repository/Zope2/lib/python/App
In directory serenade:/tmp/cvs-serv11943/App
Modified Files:
version_txt.py
Log Message:
version and platform are now taken from the Pythons sys module.
This makes FreeBSD people happy because they will never complain again
that their Zope system claims to be a Linux system.
--- Updated File version_txt.py in package Zope2 --
--- version_txt.py 1999/08/11 21:32:37 1.2
+++ version_txt.py 2001/06/11 14:50:05 1.3
@@ -83,10 +83,17 @@
#
##############################################################################
-import os
+import os,sys,string,re
+v=sys.version_info
+
def version_txt():
- try: return open(os.path.join(SOFTWARE_HOME,'version.txt')).read()
- except: return '(unreleased version)'
+
+ try:
+ s = open(os.path.join(SOFTWARE_HOME,'version.txt')).read()
+ s = re.sub("\(.*?)\?","",s)
+ s= '(%s, python %d.%d.%d, %s)' % (s,v[0],v[1],v[2],sys.platform)
+ return s
+ except:
+ return '(unreleased version, python %d.%d.%d, %s)' % (v[0],v[1],v[2],sys.platform)
- return self._v_version_txt