connection Package

connection Module

openerp_proxy.connection.connection.get_connector(name)[source]

Return connector specified by it’s name

openerp_proxy.connection.connection.get_connector_names()[source]

Returns list of connector names registered in system

class openerp_proxy.connection.connection.ConnectorBase(host, port, extra_args=None)[source]

Bases: object

Base class for all connectors

Parameters:
  • host (str) – hostname to connect to
  • port (int) – port to connect to
  • extra_args (dict) – extra arguments for specific connector.
extra_args

Connector extra arguments

get_service(name)[source]

Returns service for specified name

Parameters:name – name of service
Returns:specified service instance
host

Connector host

port

Connector port

update_extra_args(**kwargs)[source]

Update extra args and clean service cache

jsonrpc Module

class openerp_proxy.connection.jsonrpc.ConnectorJSONRPC(*args, **kwargs)[source]

Bases: openerp_proxy.connection.connection.ConnectorBase

JSON-RPC connector

available extra arguments:
  • ssl_verify: (optional) if True, the SSL cert will be verified.
class Meta[source]
name = 'json-rpc'
use_ssl = False
class openerp_proxy.connection.jsonrpc.ConnectorJSONRPCS(*args, **kwargs)[source]

Bases: openerp_proxy.connection.jsonrpc.ConnectorJSONRPC

JSON-RPCS Connector

class Meta[source]
name = 'json-rpcs'
use_ssl = True
exception openerp_proxy.connection.jsonrpc.JSONRPCError(message, code=None, data=None)[source]

Bases: openerp_proxy.exceptions.ConnectorError

JSON-RPC error wrapper

data_debug

Debug information got from Odoo server

Usualy traceback

data_message

Error message got from Odoo server

class openerp_proxy.connection.jsonrpc.JSONRPCMethod(rpc_proxy, url, service, method)[source]

Bases: object

Class that implements RPC call via json-rpc protocol

prepare_method_data(*args)[source]

Prepare data for JSON request

class openerp_proxy.connection.jsonrpc.JSONRPCProxy(host, port, service, ssl=False, ssl_verify=True)[source]

Bases: object

Simple Odoo service proxy wrapper

xmlrpc Module

class openerp_proxy.connection.xmlrpc.ConnectorXMLRPC(host, port, extra_args=None)[source]

Bases: openerp_proxy.connection.connection.ConnectorBase

XML-RPC connector

Note: extra_arguments may be same as parametrs of xmlrpclib.ServerProxy

class Meta[source]
name = 'xml-rpc'
ssl = False
ConnectorXMLRPC.get_service_url(service_name)[source]
class openerp_proxy.connection.xmlrpc.ConnectorXMLRPCS(host, port, extra_args=None)[source]

Bases: openerp_proxy.connection.xmlrpc.ConnectorXMLRPC

XML-RPCS Connector

Note: extra_arguments may be same as parametrs of xmlrpclib.ServerProxy

class Meta[source]
name = 'xml-rpcs'
ssl = True
exception openerp_proxy.connection.xmlrpc.XMLRPCError(fault_instance)[source]

Bases: openerp_proxy.exceptions.ConnectorError

Exception raised on XMLRpc errors

Parameters:fault_instance (xmlrpclib.Fault) – exception raised by XMLRPC lib
fault

Return xmlrpclib.Fault instance related to this error

class openerp_proxy.connection.xmlrpc.XMLRPCMethod(method)[source]

Bases: object

Class wrapper around XML-RPC method to wrap xmlrpclib.Fault into XMLRPCProxy

class openerp_proxy.connection.xmlrpc.XMLRPCProxy(uri, transport=None, encoding=None, verbose=0, allow_none=0, use_datetime=0, context=None)[source]

Bases: xmlrpclib.ServerProxy

Wrapper class around XML-RPC’s ServerProxy to wrap method’s errors into XMLRPCError class