![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Classes | |
| 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().
|
protected |
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.
|
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.
|
protected |
Determine if we have any encoding information in our headers.
|
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.
|
protected |
Look for VCS schemes in the URL. Returns the matched VCS scheme, or None if there's no match.
| Iterable[Link] pip._internal.index.collector.parse_links | ( | "IndexContent" | page | ) |
Parse a Simple API's Index Content, and yield its anchor elements as Link objects.
| ParseLinks pip._internal.index.collector.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`.