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

Public Member Functions

None __init__ (self, str url, Optional[Union[str, "IndexContent"]] comes_from=None, Optional[str] requires_python=None, Optional[str] yanked_reason=None, Optional[MetadataFile] metadata_file_data=None, bool cache_link_parsing=True, Optional[Mapping[str, str]] hashes=None)
 
Optional["Link"] from_json (cls, Dict[str, Any] file_data, str page_url)
 
Optional["Link"] from_element (cls, Dict[str, Optional[str]] anchor_attribs, str page_url, str base_url)
 
str __str__ (self)
 
str __repr__ (self)
 
str url (self)
 
str filename (self)
 
str file_path (self)
 
str scheme (self)
 
str netloc (self)
 
str path (self)
 
Tuple[str, str] splitext (self)
 
str ext (self)
 
str url_without_fragment (self)
 
Optional[str] subdirectory_fragment (self)
 
Optional["Link"] metadata_link (self)
 
Hashes as_hashes (self)
 
Optional[str] hash (self)
 
Optional[str] hash_name (self)
 
str show_url (self)
 
bool is_file (self)
 
bool is_existing_dir (self)
 
bool is_wheel (self)
 
bool is_vcs (self)
 
bool is_yanked (self)
 
bool has_hash (self)
 
bool is_hash_allowed (self, Optional[Hashes] hashes)
 
- Public Member Functions inherited from pip._internal.utils.models.KeyBasedCompareMixin
int __hash__ (self)
 
bool __lt__ (self, Any other)
 
bool __le__ (self, Any other)
 
bool __gt__ (self, Any other)
 
bool __ge__ (self, Any other)
 
bool __eq__ (self, Any other)
 

Public Attributes

 comes_from
 
 requires_python
 
 yanked_reason
 
 metadata_file_data
 
 cache_link_parsing
 
 egg_fragment
 
 url
 
 scheme
 
 file_path
 
 ext
 

Protected Member Functions

Optional[str] _egg_fragment (self)
 
- Protected Member Functions inherited from pip._internal.utils.models.KeyBasedCompareMixin
bool _compare (self, Any other, Callable[[Any, Any], bool] method)
 

Protected Attributes

 _parsed_url
 
 _url
 
 _hashes
 
- Protected Attributes inherited from pip._internal.utils.models.KeyBasedCompareMixin
 _compare_key
 
 _defining_class
 

Static Protected Attributes

 _egg_fragment_re = re.compile(r"[#&]egg=([^&]*)")
 
 _project_name_re
 
 _subdirectory_fragment_re = re.compile(r"[#&]subdirectory=([^&]*)")
 

Detailed Description

Represents a parsed link from a Package Index's simple URL

Constructor & Destructor Documentation

◆ __init__()

None pip._internal.models.link.Link.__init__ (   self,
str  url,
Optional[Union[str, "IndexContent"]]   comes_from = None,
Optional[str]   requires_python = None,
Optional[str]   yanked_reason = None,
Optional[MetadataFile]   metadata_file_data = None,
bool   cache_link_parsing = True,
Optional[Mapping[str, str]]   hashes = None 
)
:param url: url of the resource pointed to (href of the link)
:param comes_from: instance of IndexContent where the link was found,
    or string.
:param requires_python: String containing the `Requires-Python`
    metadata field, specified in PEP 345. This may be specified by
    a data-requires-python attribute in the HTML link tag, as
    described in PEP 503.
:param yanked_reason: the reason the file has been yanked, if the
    file has been yanked, or None if the file hasn't been yanked.
    This is the value of the "data-yanked" attribute, if present, in
    a simple repository HTML link. If the file has been yanked but
    no reason was provided, this should be the empty string. See
    PEP 592 for more information and the specification.
:param metadata_file_data: the metadata attached to the file, or None if
    no such metadata is provided. This argument, if not None, indicates
    that a separate metadata file exists, and also optionally supplies
    hashes for that file.
:param cache_link_parsing: A flag that is used elsewhere to determine
    whether resources retrieved from this link should be cached. PyPI
    URLs should generally have this set to False, for example.
:param hashes: A mapping of hash names to digests to allow us to
    determine the validity of a download.

Reimplemented from pip._internal.utils.models.KeyBasedCompareMixin.

Member Function Documentation

◆ from_element()

Optional["Link"] pip._internal.models.link.Link.from_element (   cls,
Dict[str, Optional[str]]  anchor_attribs,
str  page_url,
str  base_url 
)
Convert an anchor element's attributes in a simple repository page to a Link.

◆ from_json()

Optional["Link"] pip._internal.models.link.Link.from_json (   cls,
Dict[str, Any]  file_data,
str  page_url 
)
Convert an pypi json document from a simple repository page into a Link.

◆ is_hash_allowed()

bool pip._internal.models.link.Link.is_hash_allowed (   self,
Optional[Hashes hashes 
)
Return True if the link has a hash and it is allowed by `hashes`.

◆ metadata_link()

Optional["Link"] pip._internal.models.link.Link.metadata_link (   self)
Return a link to the associated core metadata file (if any).

◆ netloc()

str pip._internal.models.link.Link.netloc (   self)
This can contain auth information.

Member Data Documentation

◆ _project_name_re

pip._internal.models.link.Link._project_name_re
staticprotected
Initial value:
= re.compile(
r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE
)

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