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 |
WARNING this will remove all build in protocols. Use with care.
Except for tests, you should never use that function. Using it with 'http', for example, will break all http transports.
This will try to interpret location as both a URL and a directory path. It will also lookup the location in directories.
Parameters | location | Unicode or byte string object with a location |
Returns | Byte string with resulting URL | |
Raises | InvalidURL | If the location is already a URL, but not valid. |
Parameters | path | Local path as byte or unicode string |
Returns | Transport object for path |
Parameters | base | a URL |
transports | optional reusable transports list. If not None, created transports will be added to the list. | |
Returns | A new transport optionally sharing its connection with one of possible_transports. |
Parameters | base | either a URL or a directory name. |
transports | optional reusable transports list. If not None, created transports will be added to the list. | |
Returns | A new transport optionally sharing its connection with one of possible_transports. |
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.
Parameters | action | A callable, what the caller want to do while catching redirections. |
transport | The initial transport used. | |
redirected | A callable receiving the redirected transport and the RedirectRequested exception. | |
Returns | Whatever 'action' returns |