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.


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'>

Clean a version string.

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

Deprecated since version 0.8.

Try to detect the OpenERP server version.

>>> from oerplib.tools import detect_version
>>> detect_version('localhost', 'xmlrpc', 8069)
Returns:the version as string

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')
Returns:the version as tuple

Previous topic


Next topic

oerplib.tools.session (New in version 0.8)

This Page