Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
pip._vendor.distlib.locators.Locator Class Reference
Inheritance diagram for pip._vendor.distlib.locators.Locator:
Inheritance graph
[legend]
Collaboration diagram for pip._vendor.distlib.locators.Locator:
Collaboration graph
[legend]

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
 

Static Public Attributes

tuple source_extensions = ('.tar.gz', '.tar.bz2', '.tar', '.zip', '.tgz', '.tbz')
 
tuple binary_extensions = ('.egg', '.exe', '.whl')
 
tuple excluded_extensions = ('.pdf',)
 
 wheel_tags = None
 
tuple downloadable_extensions = source_extensions + ('.whl',)
 

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)
 

Detailed Description

A base class for locators - things that locate distributions.

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ _get_digest()

pip._vendor.distlib.locators.Locator._get_digest (   self,
  info 
)
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.

◆ _get_project()

pip._vendor.distlib.locators.Locator._get_project (   self,
  name 
)
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.

◆ _update_version_data()

pip._vendor.distlib.locators.Locator._update_version_data (   self,
  result,
  info 
)
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.

◆ clear_errors()

pip._vendor.distlib.locators.Locator.clear_errors (   self)
Clear any errors which may have been logged.

◆ convert_url_to_download_info()

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.

◆ get_distribution_names()

pip._vendor.distlib.locators.Locator.get_distribution_names (   self)

◆ get_errors()

pip._vendor.distlib.locators.Locator.get_errors (   self)
Return any errors which have occurred.

◆ get_project()

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.

◆ locate()

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.

◆ prefer_url()

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.

◆ score_url()

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.

◆ split_filename()

pip._vendor.distlib.locators.Locator.split_filename (   self,
  filename,
  project_name 
)
Attempt to split a filename in project name, version and Python version.

The documentation for this class was generated from the following file: