Module urllib :: Class FancyURLopener
[show private | hide private]
[frames | no frames]

Class FancyURLopener

URLopener --+
            |
           FancyURLopener

Known Subclasses:
MyURLopener, URLerrorFinder

Derived class with handlers for errors we can handle (perhaps).
Method Summary
  __init__(self, *args, **kwargs)
  get_user_passwd(self, host, realm, clear_cache)
  http_error_301(self, url, fp, errcode, errmsg, headers, data)
Error 301 -- also relocated (permanently).
  http_error_302(self, url, fp, errcode, errmsg, headers, data)
Error 302 -- relocated (temporarily).
  http_error_303(self, url, fp, errcode, errmsg, headers, data)
Error 303 -- also relocated (essentially identical to 302).
  http_error_307(self, url, fp, errcode, errmsg, headers, data)
Error 307 -- relocated, but turn POST into error.
  http_error_401(self, url, fp, errcode, errmsg, headers, data)
Error 401 -- authentication required.
  http_error_default(self, url, fp, errcode, errmsg, headers)
Default error handling -- don't raise an exception.
  prompt_user_passwd(self, host, realm)
Override this in a GUI environment!
  redirect_internal(self, url, fp, errcode, errmsg, headers, data)
  retry_http_basic_auth(self, url, realm, data)
  retry_https_basic_auth(self, url, realm, data)
    Inherited from URLopener
  __del__(self)
  addheader(self, *args)
Add a header to be used by the HTTP interface only e.g.
  cleanup(self)
  close(self)
  http_error(self, url, fp, errcode, errmsg, headers, data)
Handle http errors.
  open(self, fullurl, data)
Use URLopener().open(file) instead of open(file, 'r').
  open_data(self, url, data)
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)
Use HTTP protocol.
  open_https(self, url, data)
Use HTTPS protocol.
  open_local_file(self, url)
Use local file.
  open_unknown(self, fullurl, data)
Overridable interface to open unknown URL type.
  open_unknown_proxy(self, proxy, fullurl, data)
Overridable interface to open unknown URL type.
  retrieve(self, url, filename, reporthook, data)
retrieve(url) returns (filename, headers) for a local object or (tempfilename, headers) for a remote object.

Class Variable Summary
    Inherited from URLopener
str version = 'Python-urllib/1.15'
NoneType _URLopener__tempfiles = None                                                                  

Method Details

http_error_301(self, url, fp, errcode, errmsg, headers, data=None)

Error 301 -- also relocated (permanently).

http_error_302(self, url, fp, errcode, errmsg, headers, data=None)

Error 302 -- relocated (temporarily).

http_error_303(self, url, fp, errcode, errmsg, headers, data=None)

Error 303 -- also relocated (essentially identical to 302).

http_error_307(self, url, fp, errcode, errmsg, headers, data=None)

Error 307 -- relocated, but turn POST into error.

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.
Overrides:
urllib.URLopener.http_error_default

prompt_user_passwd(self, host, realm)

Override this in a GUI environment!

Generated by Epydoc 2.1 on Sun Jul 03 17:07:34 2005 http://epydoc.sf.net