oerplib.tools

This module contains the Config class which manage the configuration related to an instance of OERP, and some useful helper functions used internally in OERPLib.

class oerplib.tools.Config(oerp, options)

Class which manage the configuration of an OERP instance.

Note

This class have to be used through the oerplib.OERP.config property.

>>> import oerplib
>>> oerp = oerplib.OERP('localhost')
>>> type(oerp.config)
<class 'oerplib.tools.Config'>
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)

Deprecated since version 0.8.

Try to detect the 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 to a 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.tools.session (New in version 0.8)

This Page