Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Data Structures | |
class | URLopener |
class | FancyURLopener |
class | ftpwrapper |
class | addbase |
class | addclosehook |
class | addinfo |
class | addinfourl |
Functions | |
def | url2pathname |
def | pathname2url |
def | urlopen |
def | urlretrieve |
def | urlcleanup |
def | localhost |
def | thishost |
def | ftperrors |
def | noheaders |
def | basejoin |
def | toBytes |
def | unwrap |
def | splittype |
def | splithost |
def | splituser |
def | splitpasswd |
def | splitport |
def | splitnport |
def | splitquery |
def | splittag |
def | splitattr |
def | splitvalue |
def | splitgophertype |
def | unquote |
def | unquote_plus |
def | quote |
def | quote_plus |
def | urlencode |
def | getproxies_environment |
def | getproxies |
def | proxy_bypass |
def | getproxies_registry |
def | test1 |
def | reporthook |
def | test |
def | main |
Variables | |
list | __all__ |
string | __version__ = '1.15' |
int | MAXFTPCACHE = 10 |
_urlopener = None | |
dictionary | 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 | |
tuple | always_safe |
string | _fast_safe_test = always_safe+'/' |
_fast_safe = None | |
getproxies = getproxies_environment | |
tuple | fp = open(fn, 'rb') |
'gopher://gopher.micro.umn.edu/1/', More... | |
tuple | data = fp.read() |
tuple | table = string.maketrans("", "") |
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.)
def urllib.basejoin | ( | base, | |
url | |||
) |
Utility to combine a URL with a base URL to form a new URL.
Definition at line 828 of file urllib.py.
References string.rfind(), splithost(), splitquery(), splittag(), and splittype().
def urllib.ftperrors | ( | ) |
def urllib.getproxies | ( | ) |
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. Returns settings gathered from the environment, if specified, or the registry.
Definition at line 1224 of file urllib.py.
References getproxies.
def urllib.getproxies_environment | ( | ) |
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.
Definition at line 1207 of file urllib.py.
def urllib.getproxies_registry | ( | ) |
Return a dictionary of scheme -> proxy server URL mappings. Win32 uses the registry to store proxies.
Definition at line 1258 of file urllib.py.
References getproxies, getproxies_environment(), proxy_bypass(), and locale.str().
def urllib.localhost | ( | ) |
Return the IP address of the magic hostname 'localhost'.
def urllib.main | ( | ) |
def urllib.noheaders | ( | ) |
def urllib.pathname2url | ( | pathname) |
def proxy_bypass | ( | x) |
def urllib.quote | ( | s, | |
safe = '/' |
|||
) |
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.
Definition at line 1101 of file urllib.py.
References dospath.join().
def urllib.quote_plus | ( | s, | |
safe = '' |
|||
) |
Quote the query fragment of a URL; replacing ' ' with '+'
Definition at line 1132 of file urllib.py.
References dospath.join(), and quote().
def urllib.reporthook | ( | blocknum, | |
blocksize, | |||
totalsize | |||
) |
def urllib.splitattr | ( | url) |
splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].
def urllib.splitgophertype | ( | selector) |
def urllib.splithost | ( | url) |
def urllib.splitnport | ( | host, | |
defport = -1 |
|||
) |
def urllib.splitpasswd | ( | user) |
def urllib.splitport | ( | host) |
splitport('host:port') --> 'host', 'port'.
def urllib.splitquery | ( | url) |
def urllib.splittag | ( | url) |
splittag('/path#tag') --> '/path', 'tag'.
def urllib.splittype | ( | url) |
def urllib.splituser | ( | host) |
def urllib.splitvalue | ( | attr) |
def urllib.test | ( | args = [] ) |
Definition at line 1396 of file urllib.py.
References urlretrieve().
def urllib.thishost | ( | ) |
def urllib.unquote | ( | s) |
unquote('abc%20def') -> 'abc def'.
Definition at line 1055 of file urllib.py.
References dospath.join().
def urllib.unquote_plus | ( | s) |
unquote('%7e/abc+def') -> '~/abc def'
Definition at line 1074 of file urllib.py.
References dospath.join(), and unquote().
def urllib.unwrap | ( | url) |
unwrap('<URL:type://host/path>') --> 'type://host/path'.
Definition at line 914 of file urllib.py.
References string.strip().
def urllib.url2pathname | ( | pathname) |
def urllib.urlcleanup | ( | ) |
def urllib.urlencode | ( | query, | |
doseq = 0 |
|||
) |
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.
Definition at line 1142 of file urllib.py.
References dospath.join(), quote_plus(), and locale.str().
def urllib.urlopen | ( | url, | |
data = None |
|||
) |
def urllib.urlretrieve | ( | url, | |
filename = None , |
|||
reporthook = None , |
|||
data = None |
|||
) |
list __all__ |
string _fast_safe_test = always_safe+'/' |
tuple always_safe |
tuple fp = open(fn, 'rb') |
def getproxies = getproxies_environment |
tuple table = string.maketrans("", "") |