oerplib.tools

This module contains some helper functions used in OERPLib.

oerplib.tools.clean_version(version)

Clean a version string.

>>> from oerplib.tools import clean_version
>>> clean_version('7.0alpha-20121206-000102')
'7.0'
Returns:a cleaner version string
oerplib.tools.detect_version(server, protocol, port, timeout=120)

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
oerplib.tools.v(version)

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

Previous topic

oerplib.rpc

Next topic

oerplib.error

This Page