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 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'>
Clean a version string.
>>> from oerplib.tools import clean_version
>>> clean_version('7.0alpha-20121206-000102')
'7.0'
Returns: | a cleaner version string |
---|
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 |
---|
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 |
---|