b.s.c._SmartClient(object) : class documentation

Part of bzrlib.smart.client View In Hierarchy

Known subclasses: bzrlib.tests.test_remote.FakeClient

No class docstring
Method __init__ Constructor.
Method __repr__ Undocumented
Method call Call a method on the remote server.
Method call_expecting_body Call a method and return the result and the protocol object.
Method call_with_body_bytes Call a method on the remote server with body bytes.
Method call_with_body_bytes_expecting_body Call a method on the remote server with body bytes.
Method call_with_body_readv_array Undocumented
Method call_with_body_stream Undocumented
Method remote_path_from_transport Convert transport into a path suitable for using in a request.
Method _send_request Undocumented
Method _run_call_hooks Undocumented
Method _call_and_read_response Undocumented
Method _construct_protocol Undocumented
def __init__(self, medium, headers=None):
Constructor.
Parametersmediuma SmartClientMedium
def __repr__(self):
Undocumented
def _send_request(self, protocol_version, method, args, body=None, readv_body=None, body_stream=None):
Undocumented
def _run_call_hooks(self, method, args, body, readv_body):
Undocumented
def _call_and_read_response(self, method, args, body=None, readv_body=None, body_stream=None, expect_response_body=True):
Undocumented
def _construct_protocol(self, version):
Undocumented
def call(self, method, *args):
Call a method on the remote server.
def call_expecting_body(self, method, *args):

Call a method and return the result and the protocol object.

The body can be read like so:

result, smart_protocol = smart_client.call_expecting_body(...)
body = smart_protocol.read_body_bytes()
def call_with_body_bytes(self, method, args, body):
Call a method on the remote server with body bytes.
def call_with_body_bytes_expecting_body(self, method, args, body):
Call a method on the remote server with body bytes.
def call_with_body_readv_array(self, args, body):
Undocumented
def call_with_body_stream(self, args, stream):
Undocumented
def remote_path_from_transport(self, transport):
Convert transport into a path suitable for using in a request.

Note that the resulting remote path doesn't encode the host name or anything but path, so it is only safe to use it in requests sent over the medium from the matching transport.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.