![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| __init__ (self, scheme='default') | |
| get_errors (self) | |
| clear_errors (self) | |
| clear_cache (self) | |
| get_distribution_names (self) | |
| get_project (self, name) | |
| score_url (self, url) | |
| prefer_url (self, url1, url2) | |
| split_filename (self, filename, project_name) | |
| convert_url_to_download_info (self, url, project_name) | |
| locate (self, requirement, prereleases=False) | |
Public Attributes | |
| opener | |
| matcher | |
| errors | |
| downloadable_extensions | |
Protected Member Functions | |
| _get_scheme (self) | |
| _set_scheme (self, value) | |
| _get_project (self, name) | |
| _get_digest (self, info) | |
| _update_version_data (self, result, info) | |
Protected Attributes | |
| _cache | |
| _scheme | |
Properties | |
| scheme = property(_get_scheme, _set_scheme) | |
A base class for locators - things that locate distributions.
| pip._vendor.distlib.locators.Locator.__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.
Reimplemented in pip._vendor.distlib.locators.AggregatingLocator, pip._vendor.distlib.locators.DistPathLocator, pip._vendor.distlib.locators.DirectoryLocator, pip._vendor.distlib.locators.PyPIRPCLocator, pip._vendor.distlib.locators.PyPIJSONLocator, and pip._vendor.distlib.locators.SimpleScrapingLocator.
|
protected |
Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5.
|
protected |
For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None.
Reimplemented in pip._vendor.distlib.locators.PyPIRPCLocator, pip._vendor.distlib.locators.PyPIJSONLocator, pip._vendor.distlib.locators.SimpleScrapingLocator, pip._vendor.distlib.locators.DirectoryLocator, pip._vendor.distlib.locators.JSONLocator, pip._vendor.distlib.locators.DistPathLocator, and pip._vendor.distlib.locators.AggregatingLocator.
|
protected |
Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution.
| pip._vendor.distlib.locators.Locator.clear_errors | ( | self | ) |
Clear any errors which may have been logged.
| pip._vendor.distlib.locators.Locator.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.
| pip._vendor.distlib.locators.Locator.get_distribution_names | ( | self | ) |
Return all the distribution names known to this locator.
Reimplemented in pip._vendor.distlib.locators.PyPIRPCLocator, pip._vendor.distlib.locators.PyPIJSONLocator, pip._vendor.distlib.locators.SimpleScrapingLocator, pip._vendor.distlib.locators.DirectoryLocator, pip._vendor.distlib.locators.JSONLocator, and pip._vendor.distlib.locators.AggregatingLocator.
| pip._vendor.distlib.locators.Locator.get_errors | ( | self | ) |
Return any errors which have occurred.
| pip._vendor.distlib.locators.Locator.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.
| pip._vendor.distlib.locators.Locator.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.
| pip._vendor.distlib.locators.Locator.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.
| pip._vendor.distlib.locators.Locator.score_url | ( | self, | |
| url | |||
| ) |
Give an url a score which can be used to choose preferred URLs for a given project release.
| pip._vendor.distlib.locators.Locator.split_filename | ( | self, | |
| filename, | |||
| project_name | |||
| ) |
Attempt to split a filename in project name, version and Python version.