b.t.__init__ : module documentation

Part of bzrlib.transport

Transport is an abstraction layer to handle file access.

The abstraction is to allow access from the local filesystem, as well as remote (such as http or sftp).

Transports are constructed from a string, being a URL or (as a degenerate case) a local filesystem path. This is typically the top directory of a bzrdir, repository, or similar object we are interested in working with. The Transport returned has methods to read, write and manipulate files within it.

Class TransportListRegistry A registry which simplifies tracking available Transports.
Function register_transport_proto Undocumented
Function register_lazy_transport Undocumented
Function register_transport Undocumented
Function register_urlparse_netloc_protocol Ensure that protocol is setup to be used with urlparse netloc parsing.
Function unregister_transport Unregister a transport.
Class LateReadError A helper for transports which pretends to be a readable file.
Class FileStream Base class for FileStreams.
Class FileFileStream A file stream object returned by open_write_stream.
Class AppendBasedFileStream A file stream object returned by open_write_stream.
Class Transport This class encapsulates methods for retrieving or putting a file
Class ConnectedTransport A transport connected to a remote server.
Function location_to_url Determine a fully qualified URL from a location string.
Function get_transport_from_path Open a transport for a local path.
Function get_transport_from_url Open a transport to access a URL.
Function get_transport Open a transport to access a URL or directory.
Function do_catching_redirections Execute an action with given transport catching redirections.
Class Server A Transport Server.
Function _get_protocol_handlers Return a dictionary of {urlprefix: [factory]}
Function _set_protocol_handlers Replace the current protocol handlers dictionary.
Function _clear_protocol_handlers Undocumented
Function _get_transport_modules Return a list of the modules providing transports.
Function _unregister_urlparse_netloc_protocol Remove protocol from urlparse netloc parsing.
Class _CoalescedOffset A data container for keeping track of coalesced offsets.
Class _SharedConnection A connection shared between several transports.
Function _try_transport_factories Undocumented
def _get_protocol_handlers():
Return a dictionary of {urlprefix: [factory]}
def _set_protocol_handlers(new_handlers):
Replace the current protocol handlers dictionary.

WARNING this will remove all build in protocols. Use with care.

def _clear_protocol_handlers():
Undocumented
def _get_transport_modules():
Return a list of the modules providing transports.
def register_transport_proto(prefix, help=None, info=None, register_netloc=False):
Undocumented
def register_lazy_transport(prefix, module, classname):
Undocumented
def register_transport(prefix, klass, override=DEPRECATED_PARAMETER):
Undocumented
def register_urlparse_netloc_protocol(protocol):
Ensure that protocol is setup to be used with urlparse netloc parsing.
def _unregister_urlparse_netloc_protocol(protocol):
Remove protocol from urlparse netloc parsing.

Except for tests, you should never use that function. Using it with 'http', for example, will break all http transports.

def unregister_transport(scheme, factory):
Unregister a transport.
def location_to_url(location):
Determine a fully qualified URL from a location string.

This will try to interpret location as both a URL and a directory path. It will also lookup the location in directories.

ParameterslocationUnicode or byte string object with a location
ReturnsByte string with resulting URL
RaisesInvalidURLIf the location is already a URL, but not valid.
def get_transport_from_path(path, possible_transports=None):
Open a transport for a local path.
ParameterspathLocal path as byte or unicode string
ReturnsTransport object for path
def get_transport_from_url(url, possible_transports=None):
Open a transport to access a URL.
Parametersbasea URL
transportsoptional reusable transports list. If not None, created transports will be added to the list.
ReturnsA new transport optionally sharing its connection with one of possible_transports.
def get_transport(base, possible_transports=None):
Open a transport to access a URL or directory.
Parametersbaseeither a URL or a directory name.
transportsoptional reusable transports list. If not None, created transports will be added to the list.
ReturnsA new transport optionally sharing its connection with one of possible_transports.
def _try_transport_factories(base, factory_list):
Undocumented
def do_catching_redirections(action, transport, redirected):
Execute an action with given transport catching redirections.

This is a facility provided for callers needing to follow redirections silently. The silence is relative: it is the caller responsability to inform the user about each redirection or only inform the user of a user via the exception parameter.

ParametersactionA callable, what the caller want to do while catching redirections.
transportThe initial transport used.
redirectedA callable receiving the redirected transport and the RedirectRequested exception.
ReturnsWhatever 'action' returns
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.