Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
erp5
Commits
58dd3a51
Commit
58dd3a51
authored
Jun 21, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename and refactore getSystemSignatureDict to _getSystemVersionDict
Now it uses pkg_resources to collect much more versions.
parent
f9dddeb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
32 deletions
+27
-32
product/ERP5/Tool/IntrospectionTool.py
product/ERP5/Tool/IntrospectionTool.py
+27
-32
No files found.
product/ERP5/Tool/IntrospectionTool.py
View file @
58dd3a51
...
@@ -318,16 +318,10 @@ class IntrospectionTool(LogMixin, BaseTool):
...
@@ -318,16 +318,10 @@ class IntrospectionTool(LogMixin, BaseTool):
"""
"""
return
getConfiguration
().
products
return
getConfiguration
().
products
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'_getSystemVersionDict'
)
#
def
_getSystemVersionDict
(
self
):
# Library signature
#
# XXX this function can be cached to prevent disk access.
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getSystemSignatureDict'
)
def
getSystemSignatureDict
(
self
):
"""
"""
Returns a dictionnary with all versions of installed libraries
Returns a dictionnary with all versions of installed libraries
{
{
'python': '2.4.3'
'python': '2.4.3'
, 'pysvn': '1.2.3'
, 'pysvn': '1.2.3'
...
@@ -335,32 +329,33 @@ class IntrospectionTool(LogMixin, BaseTool):
...
@@ -335,32 +329,33 @@ class IntrospectionTool(LogMixin, BaseTool):
}
}
NOTE: consider using autoconf / automake tools ?
NOTE: consider using autoconf / automake tools ?
"""
"""
def
tuple_to_format_str
(
t
):
def
cached_getSystemVersionDict
():
return
'.'
.
join
([
str
(
i
)
for
i
in
t
])
import
pkg_resources
from
Products
import
ERP5
as
erp5_product
def
tuple_to_format_str
(
t
):
erp5_product_path
=
erp5_product
.
__file__
.
split
(
"/"
)[:
-
1
]
return
'.'
.
join
([
str
(
i
)
for
i
in
t
])
try
:
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
version_dict
=
{}
zope_version
=
tuple_to_format_str
(
version_txt
.
getZopeVersion
()[:
3
])
for
dist
in
pkg_resources
.
working_set
:
version_dict
[
dist
.
key
]
=
dist
.
version
from
Products
import
ERP5
as
erp5_product
erp5_product_path
=
erp5_product
.
__file__
.
split
(
"/"
)[:
-
1
]
try
:
erp5_v
=
open
(
"/"
.
join
((
erp5_product_path
)
+
[
"VERSION.txt"
])).
read
().
strip
()
erp5_version
=
erp5_v
.
replace
(
"ERP5 "
,
""
)
except
:
erp5_version
=
None
version_dict
[
"ProductS.ERP5"
]
=
erp5_version
return
version_dict
get_system_version_dict
=
CachingMethod
(
cached_getSystemVersionDict
,
id
=
'IntrospectionTool__getSystemVersionDict'
,
cache_factory
=
'erp5_content_long'
)
return
get_system_version_dict
()
from
sys
import
version_info
# Get only x.x.x numbers.
py_version
=
tuple_to_format_str
(
version_info
[:
3
])
try
:
import
pysvn
# Convert tuple to x.x.x format
pysvn_version
=
tuple_to_format_str
(
pysvn
.
version
)
except
:
pysvn_version
=
None
return
{
"python"
:
py_version
,
"pysvn"
:
pysvn_version
,
"erp5"
:
erp5_version
,
"zope"
:
zope_version
}
security
.
declareProtected
(
Permissions
.
ManagePortal
,
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'_getActivityDict'
)
'_getActivityDict'
)
def
_getActivityDict
(
self
):
def
_getActivityDict
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment