This module contains some helper functions used in OERPLib.
Clean a version string.
>>> from oerplib.tools import clean_version
>>> clean_version('7.0alpha-20121206-000102')
'7.0'
Returns: | a cleaner version string |
---|
Try to detect the OpenERP server version.
>>> from oerplib.tools import detect_version
>>> detect_version('localhost', 'xmlrpc', 8069)
'7.0'
Returns: | the version as string |
---|
Convert a version string in tuple. The tuple can be use to compare versions between them.
>>> from oerplib.tools import v
>>> v('7.0')
[7, 0]
>>> v('6.1')
[6, 1]
>>> v('7.0') < v('6.1')
False
Returns: | the version as tuple |
---|