OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, scheme='default') |
def | get_errors (self) |
def | clear_errors (self) |
def | clear_cache (self) |
def | get_distribution_names (self) |
def | get_project (self, name) |
def | score_url (self, url) |
def | prefer_url (self, url1, url2) |
def | split_filename (self, filename, project_name) |
def | convert_url_to_download_info (self, url, project_name) |
def | locate (self, requirement, prereleases=False) |
Data Fields | |
opener | |
matcher | |
errors | |
Static Public Attributes | |
source_extensions | |
binary_extensions | |
excluded_extensions | |
wheel_tags | |
downloadable_extensions | |
Properties | |
scheme = property(_get_scheme, _set_scheme) | |
A base class for locators - things that locate distributions.
def __init__ | ( | self, | |
scheme = 'default' |
|||
) |
Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI.
def clear_cache | ( | self | ) |
Reimplemented in AggregatingLocator.
def clear_errors | ( | self | ) |
Clear any errors which may have been logged.
def convert_url_to_download_info | ( | self, | |
url, | |||
project_name | |||
) |
See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned.
def get_distribution_names | ( | self | ) |
Return all the distribution names known to this locator.
Reimplemented in AggregatingLocator, JSONLocator, DirectoryLocator, SimpleScrapingLocator, PyPIJSONLocator, and PyPIRPCLocator.
def get_errors | ( | self | ) |
Return any errors which have occurred.
def get_project | ( | self, | |
name | |||
) |
For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top.
def locate | ( | self, | |
requirement, | |||
prereleases = False |
|||
) |
Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located.
def prefer_url | ( | self, | |
url1, | |||
url2 | |||
) |
Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name.
def score_url | ( | self, | |
url | |||
) |
Give an url a score which can be used to choose preferred URLs for a given project release.
def split_filename | ( | self, | |
filename, | |||
project_name | |||
) |
Attempt to split a filename in project name, version and Python version.
|
static |
|
static |
errors |
|
static |
matcher |
opener |
|
static |
|
static |
|
static |