ResourceFetcher
- class plutoprint.ResourceFetcher[source]
Base class for fetching external resources.
- fetch_url(url: str) ResourceData[source]
Fetches a resource from the specified URL. This method can be overridden in derived classes.
- Parameters:
url – The URL of the resource.
- Returns:
The fetched resource data.
- class plutoprint.DefaultResourceFetcher[source]
Default implementation of ResourceFetcher.
- set_ssl_cainfo(path: str | bytes | PathLike) None[source]
Sets the path to a file containing trusted CA certificates.
If not set, no custom CA file is used.
- Parameters:
path – Path to the CA certificate bundle file.
- set_ssl_capath(path: str | bytes | PathLike) None[source]
Sets the path to a directory containing trusted CA certificates.
If not set, no custom CA path is used.
- Parameters:
path – Path to the directory with CA certificates.
- set_ssl_verify_peer(verify: bool) None[source]
Enables or disables SSL peer certificate verification.
If not set, verification is enabled by default.
- Parameters:
verify – True to verify the peer, False to disable verification.
- set_ssl_verify_host(verify: bool) None[source]
Enables or disables SSL host name verification.
If not set, verification is enabled by default.
- Parameters:
verify – True to verify the host, False to disable verification.
- set_http_follow_redirects(follow: bool) None[source]
Enables or disables automatic following of HTTP redirects.
If not set, following redirects is enabled by default.
- Parameters:
follow – True to follow redirects, False to disable.
- plutoprint.default_resource_fetcher: DefaultResourceFetcher = Ellipsis
Represents the default fetcher used to fetch external resources such as stylesheets, fonts, and images.