This module contains some helper functions used to save and load sessions in OERPLib.
Return the session configuration identified by name from the rc_file file.
>>> import oerplib
>>> oerplib.tools.session.get('foo')
{'protocol': 'xmlrpc', 'user': 'admin', 'timeout': 120, 'database': 'db_name', 'passwd': 'admin', 'type': 'OERP', 'port': 8069, 'server': 'localhost'}
Raise: | oerplib.error.Error |
---|
Return all session configurations from the rc_file file.
>>> import oerplib
>>> oerplib.tools.session.get_all()
{'foo': {'protocol': 'xmlrpc', 'user': 'admin', 'timeout': 120, 'database': 'db_name', 'passwd': 'admin', 'type': 'OERP', 'port': 8069, 'server': 'localhost'}}
Remove the session configuration identified by name from the rc_file file.
>>> import oerplib
>>> oerplib.tools.session.remove('foo')
Raise: | oerplib.error.Error |
---|
Save the data session configuration under the name name in the rc_file file.
>>> import oerplib
>>> oerplib.tools.session.save('foo', {'type': 'OERP', 'server': 'localhost', 'protocol': 'xmlrpc', 'port': 8069, 'timeout': 120, 'user': 'admin', 'passwd': 'admin', 'database': 'db_name'})