l.c.i.g.IGitLookup(Interface) : interface documentation

Part of lp.code.interfaces.gitlookup View In Hierarchy

Utility for looking up a Git repository by name.
Method get Return the repository with the given id.
Method getByHostingPath Get information about a given path on the hosting backend.
Method getByUniqueName Find a repository by its unique name.
Method uriToPath Return the path for the URI, if the URI is on codehosting.
Method getByUrl Find a repository by URL.
Method getByPath Find a repository by its path.
def get(repository_id, default=None):
Return the repository with the given id.

Return the default value if there is no such repository.

def getByHostingPath(path):
Get information about a given path on the hosting backend.
ReturnsAn IGitRepository, or None.
def getByUniqueName(unique_name):

Find a repository by its unique name.

Unique names have one of the following forms:
~OWNER/PROJECT/+git/NAME ~OWNER/DISTRO/+source/SOURCE/+git/NAME ~OWNER/+git/NAME
ReturnsAn IGitRepository, or None.
def uriToPath(uri):
Return the path for the URI, if the URI is on codehosting.

This does not ensure that the path is valid.

ParametersuriAn instance of lazr.uri.URI
ReturnsThe path if possible; None if the URI is not a valid codehosting URI.
def getByUrl(url):
Find a repository by URL.

Either from the URL on git.launchpad.net (various schemes) or the lp: URL (which relies on client-side configuration).

def getByPath(path):

Find a repository by its path.

Any of these forms may be used, with or without a leading slash:
Unique names:
~OWNER/PROJECT/+git/NAME ~OWNER/DISTRO/+source/SOURCE/+git/NAME ~OWNER/+git/NAME
Owner-target default aliases:
~OWNER/PROJECT ~OWNER/DISTRO/+source/SOURCE
Official aliases:
PROJECT DISTRO/+source/SOURCE
ReturnsA tuple of (IGitRepository, extra_path), or (None, _). 'extra_path' may be used by applications that need to traverse a leading part of a path as a repository, such as external code browsers.
API Documentation for Launchpad, generated by pydoctor at 2019-12-08 00:00:15.