Trees | Indices | Help |
|
---|
|
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.)
Version: 1.17
|
|||
ContentTooShortError | |||
URLopener Class to open URLs. |
|||
FancyURLopener Derived class with handlers for errors we can handle (perhaps). |
|||
ftpwrapper Class used by open_ftp() for cache of open FTP connections. |
|||
addbase Base class for addinfo and addclosehook. |
|||
addclosehook Class to add a close hook to an open file. |
|||
addinfo class to add an info() method to an open file. |
|||
addinfourl class to add info() and geturl() methods to an open file. |
|
|||
|
|||
|
|||
|
|||
open file-like object |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
MAXFTPCACHE = 10
|
|||
_urlopener = None
|
|||
ftpcache =
|
|||
_localhost = None
|
|||
_thishost = None
|
|||
_ftperrors = None
|
|||
_noheaders = None
|
|||
_typeprog = None
|
|||
_hostprog = None
|
|||
_userprog = None
|
|||
_passwdprog = None
|
|||
_portprog = None
|
|||
_nportprog = None
|
|||
_queryprog = None
|
|||
_tagprog = None
|
|||
_valueprog = None
|
|||
_hextochr =
|
|||
always_safe =
|
|||
_safemaps =
|
Imports: string, socket, os, time, sys
|
Split host and port, returning numeric port. Return given default port if no ':' found; defaults to -1. Return numerical port if a valid number are found after ':'. Return None if ':' but not a valid number. |
quote('abc def') -> 'abc%20def' Each part of a URL, e.g. the path info, the query, etc., has a different set of reserved characters that must be quoted. RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists the following reserved characters. reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," Each of these characters is reserved in some component of a URL, but not necessarily in all of them. By default, the quote function is intended for quoting the path section of a URL. Thus, it will not encode '/'. This character is reserved, but in typical usage the quote function is being called on a path where the existing slash characters are used as reserved characters. |
Encode a sequence of two-element tuples or dictionary into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output will match the order of parameters in the input. |
Return a dictionary of scheme -> proxy server URL mappings. Scan the environment for variables named <scheme>_proxy; this seems to be the standard convention. If you need a different way, you can pass a proxies dictionary to the [Fancy]URLopener constructor. |
Return a dictionary of scheme -> proxy server URL mappings. By convention the mac uses Internet Config to store proxies. An HTTP proxy, for instance, is stored under the HttpProxy key. |
Return a dictionary of scheme -> proxy server URL mappings. Win32 uses the registry to store proxies. |
Return a dictionary of scheme -> proxy server URL mappings. Scan the environment for variables named <scheme>_proxy; this seems to be the standard convention. If you need a different way, you can pass a proxies dictionary to the [Fancy]URLopener constructor. |
|
_hextochr
|
always_safe
|
_safemaps
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Tue Jan 29 22:41:31 2008 | http://epydoc.sourceforge.net |