Let us walk on the 3-isogeny graph
|
Data Structures | |
class | _NotAPIContent |
class | _NotHTTP |
class | CacheablePageContent |
class | CollectedSources |
class | HTMLLinkParser |
class | IndexContent |
class | LinkCollector |
class | ParseLinks |
Functions | |
Optional[str] | _match_vcs_scheme (str url) |
None | _ensure_api_header (Response response) |
None | _ensure_api_response (str url, PipSession session) |
Response | _get_simple_response (str url, PipSession session) |
Optional[str] | _get_encoding_from_headers (ResponseHeaders headers) |
ParseLinks | with_cached_index_content (ParseLinks fn) |
Iterable[Link] | parse_links ("IndexContent" page) |
None | _handle_get_simple_fail (Link link, Union[str, Exception] reason, Optional[Callable[..., None]] meth=None) |
IndexContent | _make_index_content (Response response, bool cache_link_parsing=True) |
Optional["IndexContent"] | _get_index_content (Link link, *PipSession session) |
Variables | |
Protocol = object | |
logger = logging.getLogger(__name__) | |
ResponseHeaders = MutableMapping[str, str] | |
The main purpose of this module is to expose LinkCollector.collect_sources().
Check the Content-Type header to ensure the response contains a Simple API Response. Raises `_NotAPIContent` if the content type is not a valid content-type.
Definition at line 73 of file collector.py.
References i.
Referenced by pip._internal.index.collector._get_simple_response().
|
protected |
Send a HEAD request to the URL, and ensure the response contains a simple API Response. Raises `_NotHTTP` if the URL is not available for a HEAD request, or `_NotAPIContent` if the content type is not a valid content type.
Definition at line 99 of file collector.py.
Referenced by pip._internal.index.collector._get_simple_response().
|
protected |
Determine if we have any encoding information in our headers.
Definition at line 180 of file collector.py.
References i.
Referenced by pip._internal.index.collector._make_index_content().
|
protected |
Definition at line 336 of file collector.py.
References pip._internal.index.collector._get_simple_response(), pip._internal.index.collector._handle_get_simple_fail(), pip._internal.index.collector._make_index_content(), pip._internal.index.collector._match_vcs_scheme(), and i.
Referenced by LinkCollector.fetch_response().
|
protected |
Access an Simple API response with GET, and return the response. This consists of three parts: 1. If the URL looks suspiciously like an archive, send a HEAD first to check the Content-Type is HTML or Simple API, to avoid downloading a large file. Raise `_NotHTTP` if the content type cannot be determined, or `_NotAPIContent` if it is not HTML or a Simple API. 2. Actually perform the request. Raise HTTP exceptions on network failures. 3. Check the Content-Type header to make sure we got a Simple API response, and raise `_NotAPIContent` otherwise.
Definition at line 117 of file collector.py.
References pip._internal.index.collector._ensure_api_header(), pip._internal.index.collector._ensure_api_response(), and i.
Referenced by pip._internal.index.collector._get_index_content().
|
protected |
Definition at line 313 of file collector.py.
References i.
Referenced by pip._internal.index.collector._get_index_content().
|
protected |
Definition at line 323 of file collector.py.
References pip._internal.index.collector._get_encoding_from_headers(), and i.
Referenced by pip._internal.index.collector._get_index_content().
|
protected |
Look for VCS schemes in the URL. Returns the matched VCS scheme, or None if there's no match.
Definition at line 55 of file collector.py.
References i.
Referenced by pip._internal.index.collector._get_index_content().
Iterable[Link] parse_links | ( | "IndexContent" | page | ) |
Parse a Simple API's Index Content, and yield its anchor elements as Link objects.
Definition at line 229 of file collector.py.
References i.
ParseLinks with_cached_index_content | ( | ParseLinks | fn | ) |
Given a function that parses an Iterable[Link] from an IndexContent, cache the function's result (keyed by CacheablePageContent), unless the IndexContent `page` has `page.cache_link_parsing == False`.
Definition at line 208 of file collector.py.
References i.
logger = logging.getLogger(__name__) |
Definition at line 50 of file collector.py.
Protocol = object |
Definition at line 48 of file collector.py.
ResponseHeaders = MutableMapping[str, str] |
Definition at line 52 of file collector.py.