| |
- URLopener
-
- FancyURLopener
- addbase
-
- addclosehook
- addinfo
- addinfourl
- ftpwrapper
class FancyURLopener(URLopener) |
|
no doc string |
| |
- __init__(self, *args)
- no doc string
- get_user_passwd(self, host, realm, clear_cache=0)
- no doc string
- http_error_302(self, url, fp, errcode, errmsg, headers, data=None)
- # Error 302 -- relocated (temporarily)
- http_error_302(self, url, fp, errcode, errmsg, headers, data=None)
- # Error 302 -- relocated (temporarily)
- http_error_401(self, url, fp, errcode, errmsg, headers, data=None)
- # Error 401 -- authentication required
- # See this URL for a description of the basic authentication scheme:
- # http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt
- http_error_default(self, url, fp, errcode, errmsg, headers)
- # Default error handling -- don't raise an exception
- prompt_user_passwd(self, host, realm)
- no doc string
- retry_http_basic_auth(self, url, realm, data)
- no doc string
|
class URLopener |
|
# Class to open URLs.
# This is a class rather than just a subroutine because we may need
# more than one set of global protocol-specific options.
# Note -- this is a base class for those who don't want the
# automatic handling of errors type 302 (relocated) and 401
# (authorization needed).
|
| |
- __del__(self)
- no doc string
- __init__(self, proxies=None)
- # Constructor
- addheader(self, *args)
- # Add a header to be used by the HTTP interface only
- # e.g. u.addheader('Accept', 'sound/basic')
- cleanup(self)
- no doc string
- close(self)
- no doc string
- http_error(self, url, fp, errcode, errmsg, headers, data=None)
- # Handle http errors.
- # Derived class can override this, or provide specific handlers
- # named http_error_DDD where DDD is the 3-digit error code
- http_error_default(self, url, fp, errcode, errmsg, headers)
- # Default http error handler: close the connection and raises IOError
- open(self, fullurl, data=None)
- # External interface
- # Use URLopener().open(file) instead of open(file, 'r')
- open_data(self, url, data=None)
- # Use "data" URL
- open_file(self, url)
- # Use local file or FTP depending on form of URL
- open_ftp(self, url)
- # Use FTP protocol
- open_gopher(self, url)
- # Use Gopher protocol
- open_http(self, url, data=None)
- # Use HTTP protocol
- open_local_file(self, url)
- # Use local file
- open_unknown(self, fullurl, data=None)
- # Overridable interface to open unknown URL type
- retrieve(self, url, filename=None, reporthook=None)
- # External interface
- # retrieve(url) returns (filename, None) for a local object
- # or (tempfilename, headers) for a remote object
|
|