l.s.t.URLFetcher : class documentation

Part of lp.services.timeout View In Hierarchy

Object fetching remote URLs with a time out.
Method __init__ Undocumented
Method fetch Fetch the URL using a custom HTTP handler supporting timeout.
Method cleanup Reset the connection when the operation timed out.
def __init__(self):
Undocumented
@with_timeout('cleanup')
def fetch(self, url, use_proxy=False, allow_ftp=False, allow_file=False, output_file=None, **request_kwargs):
Fetch the URL using a custom HTTP handler supporting timeout.
ParametersurlThe URL to fetch.
use_proxyIf True, use Launchpad's configured proxy.
allow_ftpIf True, allow ftp:// URLs.
allow_fileIf True, allow file:// URLs. (Be careful to only pass this if the URL is trusted.)
output_fileIf not None, download the response content to this file object or path.
request_kwargsAdditional keyword arguments passed on to Session.request.
def cleanup(self):
Reset the connection when the operation timed out.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.