urllib (version 1.10)
index
/usr/lib/python1.5/urllib.py
 

# Open an arbitrary URL
#
# See the following document for more info on URLs:
# "Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
#
# See also the HTTP spec (from which the error codes are derived):
# "HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols/
#
# Related standards and specs:
# - RFC1808: the "relative URL" spec. (authoritative status)
# - RFC1738 - the "URL standard". (authoritative status)
# - RFC1630 - the "URI spec". (informational status)
#
# The object returned by URLopener().open(file) will differ per
# protocol.  All you know is that is has methods read(), readline(),
# readlines(), fileno(), close() and info().  The read*(), fileno()
# and close() methods work like those of open files. 
# The info() method returns a mimetools.Message object which can be
# used to query various info about the object, if available.
# (mimetools.Message objects are queried with the getheader() method.)

   
Modules
                        
os
socket
string
sys

   
Classes
                        
URLopener
FancyURLopener
addbase
addclosehook
addinfo
addinfourl
ftpwrapper

   
class FancyURLopener(URLopener)
              
__init__(self, *args)
get_user_passwd(self, host, realm, clear_cache=0)
http_error_302(self, url, fp, errcode, errmsg, headers, data=None)
http_error_302(self, url, fp, errcode, errmsg, headers, data=None)
http_error_401(self, url, fp, errcode, errmsg, headers, data=None)
http_error_default(self, url, fp, errcode, errmsg, headers)
prompt_user_passwd(self, host, realm)
retry_http_basic_auth(self, url, realm, data)

   
class URLopener
              
__del__(self)
__init__(self, proxies=None)
addheader(self, *args)
cleanup(self)
close(self)
http_error(self, url, fp, errcode, errmsg, headers, data=None)
http_error_default(self, url, fp, errcode, errmsg, headers)
open(self, fullurl, data=None)
open_data(self, url, data=None)
open_file(self, url)
open_ftp(self, url)
open_gopher(self, url)
open_http(self, url, data=None)
open_local_file(self, url)
open_unknown(self, fullurl, data=None)
retrieve(self, url, filename=None, reporthook=None)

   
class addbase
            # Base class for addinfo and addclosehook
              
__init__(self, fp)
__repr__(self)
close(self)

   
class addclosehook(addbase)
              
__init__(self, fp, closehook, *hookargs)
close(self)

   
class addinfo(addbase)
              
__init__(self, fp, headers)
info(self)

   
class addinfourl(addbase)
              
__init__(self, fp, headers, url)
geturl(self)
info(self)

   
class ftpwrapper
            # Class used by open_ftp() for cache of open FTP connections
              
__init__(self, user, passwd, host, port, dirs)
close(self)
endtransfer(self)
init(self)
retrfile(self, file, type)

   
Constants
                        
MAXFTPCACHE = 10
always_safe = 'abcdefghijklmnopqrstuvw...QRSTUVWXYZ0123456789_,.-'