l.c.v._.LaunchpadServer(_BaseLaunchpadServer) : class documentation

Part of lp.codehosting.vfs View In Hierarchy

The Server used for the public SSH codehosting service.

This server provides a VFS that backs onto a transport that stores branches by id. The TransportDispatch object takes care of showing a writeable or read-only view of each branch as appropriate.

In addition to basic VFS operations, this server provides operations for creating a branch and requesting for a branch to be mirrored. The associated transport, AsyncLaunchpadTransport, has hooks in certain filesystem-level operations to trigger these.

Method __init__ Construct a LaunchpadServer.
Method createBranch Make a new directory for the given virtual URL fragment.
Method branchChanged Notify Launchpad of a change to the a branch.
Method unexpectedError Undocumented
Method _normalize_stacked_on_url Normalize and return the stacked-on location of branch.

Inherited from _BaseLaunchpadServer:

Method translateVirtualPath See AsyncVirtualServer.translateVirtualPath.

Inherited from AsyncVirtualServer (via _BaseLaunchpadServer):

Method get_url Return the URL of this server.
Method start_server See Server.start_server.
Method stop_server See Server.stop_server.
Method _transportFactory Create a transport for this server pointing at url.
def __init__(self, codehosting_api, user_id, branch_transport, seen_new_branch_hook=None):
Construct a LaunchpadServer.

See _BaseLaunchpadServer for more information.

Parameterscodehosting_apiAn object that has 'createBranch' and 'branchChanged' methods in addition to a 'translatePath' method. These methods should return Deferreds. XXX: JonathanLange 2008-11-19: Specify this interface better.
user_idThe database ID of the user to connect as.
branch_transportA Bazaar Transport that points to the "hosted" area of Launchpad. See module docstring for more information.
seen_new_branch_hookA callable that will be called once for each branch accessed via this server.
def createBranch(self, virtual_url_fragment):
Make a new directory for the given virtual URL fragment.

If virtual_url_fragment is a branch directory, create the branch in the database, then create a matching directory on the backing transport.

Parametersvirtual_url_fragmentA virtual path to be translated.
RaisesNotABranchPathIf virtual_path does not have at least a valid path to a branch.
NotEnoughInformationIf virtual_path does not map to a branch.
PermissionDeniedIf the branch cannot be created in the database. This might indicate that the branch already exists, or that its creation is forbidden by a policy.
FaultIf the XML-RPC server raises errors.
def _normalize_stacked_on_url(self, branch):
Normalize and return the stacked-on location of branch.

In the common case, branch will either be unstacked or stacked on a relative path, in which case this is very easy: just return the location.

If branch is stacked on the absolute URL of another Launchpad branch, we normalize this to a relative path (mutating the branch) and return the relative path.

If branch is stacked on some other absolute URL we don't recognise, we just return that and rely on the branchChanged XML-RPC method recording a complaint in the appropriate place.

def branchChanged(self, virtual_url_fragment):
Notify Launchpad of a change to the a branch.

This method tries hard to not exit via an exception, because the client side experience is not good in that case. Instead, log.err() is called, which will result in an OOPS being logged.

Parametersvirtual_url_fragmentA url fragment that points to a path owned by a branch.
def unexpectedError(self, failure, request=None):
API Documentation for Launchpad, generated by pydoctor at 2018-02-24 00:00:04.