OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | should_add_vcs_url_prefix (cls, remote_url) |
def | get_subdirectory (cls, location) |
def | get_requirement_revision (cls, repo_dir) |
def | get_src_requirement (cls, repo_dir, project_name) |
def | is_immutable_rev_checkout (self, url, dest) |
def | make_rev_options (cls, rev=None, extra_args=None) |
def | get_netloc_and_auth (cls, netloc, scheme) |
def | get_url_rev_and_auth (cls, url) |
def | get_url_rev_options (self, url) |
def | compare_urls (cls, url1, url2) |
def | fetch_new (self, dest, url, rev_options) |
def | switch (self, dest, url, rev_options) |
def | update (self, dest, url, rev_options) |
def | is_commit_id_equal (cls, dest, name) |
def | obtain (self, dest, url) |
def | unpack (self, location, url) |
def | get_remote_url (cls, location) |
def | get_revision (cls, location) |
def | run_command (cls, cmd, show_stdout=True, cwd=None, on_returncode='raise', extra_ok_returncodes=None, command_desc=None, extra_environ=None, spinner=None, log_failed_cmd=True, stdout_only=False) |
def | is_repository_directory (cls, path) |
def | get_repository_root (cls, location) |
Static Public Member Functions | |
def | get_base_rev_args (rev) |
def | make_rev_args (username, password) |
def | normalize_url (url) |
Static Public Attributes | |
name | |
dirname | |
repo_name | |
schemes | |
unset_environ | |
default_arg_rev | |
def compare_urls | ( | cls, | |
url1, | |||
url2 | |||
) |
Compare two repo URLs for identity, ignoring incidental differences.
def fetch_new | ( | self, | |
dest, | |||
url, | |||
rev_options | |||
) |
Fetch a revision from a repository, in the case that this is the first fetch from the repository. Args: dest: the directory to fetch the repository to. rev_options: a RevOptions object.
Reimplemented in Subversion, Git, Mercurial, and Bazaar.
|
static |
Return the base revision arguments for a vcs command. Args: rev: the name of a revision to install. Cannot be None.
Reimplemented in Git, Subversion, Mercurial, and Bazaar.
def get_netloc_and_auth | ( | cls, | |
netloc, | |||
scheme | |||
) |
Parse the repository URL's netloc, and return the new netloc to use along with auth information. Args: netloc: the original repository URL netloc. scheme: the repository URL's scheme without the vcs prefix. This is mainly for the Subversion class to override, so that auth information can be provided via the --username and --password options instead of through the URL. For other subclasses like Git without such an option, auth information must stay in the URL. Returns: (netloc, (username, password)).
Reimplemented in Subversion.
def get_remote_url | ( | cls, | |
location | |||
) |
Return the url used at location Raises RemoteNotFoundError if the repository does not have a remote url configured.
Reimplemented in Git, Subversion, Mercurial, and Bazaar.
def get_repository_root | ( | cls, | |
location | |||
) |
Return the "root" (top-level) directory controlled by the vcs, or `None` if the directory is not in any. It is meant to be overridden to implement smarter detection mechanisms for specific vcs. This can do more than is_repository_directory() alone. For example, the Git override checks that Git is actually available.
def get_requirement_revision | ( | cls, | |
repo_dir | |||
) |
Return the revision string that should be used in a requirement.
Reimplemented in Mercurial.
def get_revision | ( | cls, | |
location | |||
) |
Return the current commit id of the files at the given location.
Reimplemented in Mercurial, Bazaar, and Subversion.
def get_src_requirement | ( | cls, | |
repo_dir, | |||
project_name | |||
) |
Return the requirement string to use to redownload the files currently at the given repository directory. Args: project_name: the (unescaped) project name. The return value has a form similar to the following: {repository_url}@{revision}#egg={project_name}
def get_subdirectory | ( | cls, | |
location | |||
) |
def get_url_rev_and_auth | ( | cls, | |
url | |||
) |
Parse the repository URL to use, and return the URL, revision, and auth info to use. Returns: (url, rev, (username, password)).
Reimplemented in Git, Subversion, and Bazaar.
def get_url_rev_options | ( | self, | |
url | |||
) |
Return the URL and RevOptions object to use in obtain(), as a tuple (url, rev_options).
def is_commit_id_equal | ( | cls, | |
dest, | |||
name | |||
) |
Return whether the id of the current commit equals the given name. Args: dest: the repository directory. name: a string name.
Reimplemented in Git, Subversion, Mercurial, and Bazaar.
def is_immutable_rev_checkout | ( | self, | |
url, | |||
dest | |||
) |
Return true if the commit hash checked out at dest matches the revision in url. Always return False, if the VCS does not support immutable commit hashes. This method does not check if there are local uncommitted changes in dest after checkout, as pip currently has no use case for that.
Reimplemented in Git.
def is_repository_directory | ( | cls, | |
path | |||
) |
Return whether a directory path is a repository directory.
|
static |
Return the RevOptions "extra arguments" to use in obtain().
Reimplemented in Subversion.
def make_rev_options | ( | cls, | |
rev = None , |
|||
extra_args = None |
|||
) |
Return a RevOptions object. Args: rev: the name of a revision to install. extra_args: a list of extra options.
|
static |
Normalize a URL for comparison by unquoting it and removing any trailing slash.
def obtain | ( | self, | |
dest, | |||
url | |||
) |
Install or update in editable mode the package represented by this VersionControl object. :param dest: the repository directory in which to install or update. :param url: the repository URL starting with a vcs prefix.
def run_command | ( | cls, | |
cmd, | |||
show_stdout = True , |
|||
cwd = None , |
|||
on_returncode = 'raise' , |
|||
extra_ok_returncodes = None , |
|||
command_desc = None , |
|||
extra_environ = None , |
|||
spinner = None , |
|||
log_failed_cmd = True , |
|||
stdout_only = False |
|||
) |
Run a VCS subcommand This is simply a wrapper around call_subprocess that adds the VCS command name, and checks that the VCS is available
def should_add_vcs_url_prefix | ( | cls, | |
remote_url | |||
) |
Return whether the vcs prefix (e.g. "git+") should be added to a repository's remote url when used in a requirement.
Reimplemented in Subversion.
def switch | ( | self, | |
dest, | |||
url, | |||
rev_options | |||
) |
Switch the repo at ``dest`` to point to ``URL``. Args: rev_options: a RevOptions object.
Reimplemented in Subversion, Git, Mercurial, and Bazaar.
def unpack | ( | self, | |
location, | |||
url | |||
) |
Clean up current location and download the url repository (and vcs infos) into location :param url: the repository URL starting with a vcs prefix.
def update | ( | self, | |
dest, | |||
url, | |||
rev_options | |||
) |
Update an already-existing repo to the given ``rev_options``. Args: rev_options: a RevOptions object.
Reimplemented in Subversion, Git, Mercurial, and Bazaar.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |