Commit 5cf9ef0a authored by Rafael Monnerat's avatar Rafael Monnerat

Get zope version from App.version_txt instead search for a file. Tiny...

Get zope version from App.version_txt instead search for a file. Tiny modification for get erp5 version.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32378 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2689755b
...@@ -426,8 +426,14 @@ class IntrospectionTool(LogMixin, BaseTool): ...@@ -426,8 +426,14 @@ class IntrospectionTool(LogMixin, BaseTool):
return '.'.join([str(i) for i in t]) return '.'.join([str(i) for i in t])
from Products import ERP5 as erp5_product from Products import ERP5 as erp5_product
erp5_product_path = erp5_product.__file__.split("/")[:-1] erp5_product_path = erp5_product.__file__.split("/")[:-1]
erp5_version = open("/".join((erp5_product_path) + ["VERSION.txt"])).read().strip() try:
zope_version = open(getConfiguration().softwarehome + "/version.txt").read().strip() erp5_v = open("/".join((erp5_product_path) + ["VERSION.txt"])).read().strip()
erp5_version = erp5_v.replace("ERP5 ", "")
except:
erp5_version = None
from App import version_txt
zope_version = tuple_to_format_str(version_txt.getZopeVersion()[:2])
from sys import version_info from sys import version_info
# Get only x.x.x numbers. # Get only x.x.x numbers.
...@@ -439,11 +445,8 @@ class IntrospectionTool(LogMixin, BaseTool): ...@@ -439,11 +445,8 @@ class IntrospectionTool(LogMixin, BaseTool):
except: except:
pysvn_version = None pysvn_version = None
return { return { "python" : py_version , "pysvn" : pysvn_version ,
"python" : py_version , "erp5" : erp5_version, "zope" : zope_version
"pysvn" : pysvn_version ,
"erp5" : erp5_version.replace("ERP5 ", ""),
"zope" : zope_version.replace("Zope ", "")
} }
InitializeClass(IntrospectionTool) InitializeClass(IntrospectionTool)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment