Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | __del__ |
def | close |
def | cleanup |
def | addheader |
def | open |
def | open_unknown |
def | open_unknown_proxy |
def | retrieve |
def | open_http |
def | http_error |
def | http_error_default |
def | open_https |
def | open_gopher |
def | open_file |
def | open_local_file |
def | open_ftp |
def | open_data |
Data Fields | |
proxies | |
key_file | |
cert_file | |
addheaders | |
tempcache | |
ftpcache | |
type | |
Static Public Attributes | |
string | version = "Python-urllib/%s" |
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).
def __init__ | ( | self, | |
proxies = None , |
|||
x509 | |||
) |
def __del__ | ( | self) |
Definition at line 123 of file urllib.py.
References FileWrapper.close(), StringIO.close(), Shelf.close(), Chunk.close(), _Subfile.close(), SGMLParser.close(), openrsrc.close(), URLopener.close(), _socketobject.close(), SSLFakeSocket.close(), _Hqxcoderengine.close(), SSLFakeFile.close(), FileInput.close(), TemporaryFileWrapper.close(), _fileobject.close(), _Rlecoderengine.close(), HTTPResponse.close(), BinHex.close(), GzipFile.close(), Telnet.close(), Au_read.close(), _Hqxdecoderengine.close(), Aifc_read.close(), _Rledecoderengine.close(), HTTPConnection.close(), Au_write.close(), HexBin.close(), TestSGMLParser.close(), file_wrapper.close(), FTP.close(), SMTP.close(), and HTTP.close().
def addheader | ( | self, | |
args | |||
) |
Add a header to be used by the HTTP interface only e.g. u.addheader('Accept', 'sound/basic')
def cleanup | ( | self) |
Definition at line 129 of file urllib.py.
References URLopener.__tempfiles, URLopener.__unlink, and URLopener.tempcache.
def close | ( | self) |
def 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.
Definition at line 305 of file urllib.py.
References URLopener.http_error_default().
def http_error_default | ( | self, | |
url, | |||
fp, | |||
errcode, | |||
errmsg, | |||
headers | |||
) |
def open | ( | self, | |
fullurl, | |||
data = None |
|||
) |
Use URLopener().open(file) instead of open(file, 'r').
Definition at line 149 of file urllib.py.
References URLopener.proxies, urllib.splithost(), urllib.splittype(), URLopener.tempcache, urllib.toBytes(), and urllib.unwrap().
def open_data | ( | self, | |
url, | |||
data = None |
|||
) |
Use "data" URL.
Definition at line 491 of file urllib.py.
References base64.decodestring(), dospath.join(), and urllib.unquote().
def open_file | ( | self, | |
url | |||
) |
Use local file or FTP depending on form of URL.
Definition at line 400 of file urllib.py.
References URLopener.open_ftp(), and URLopener.open_local_file().
def open_ftp | ( | self, | |
url | |||
) |
Use FTP protocol.
Definition at line 435 of file urllib.py.
References URLopener.ftpcache, urllib.ftperrors(), mimetypes.guess_type(), dospath.join(), urllib.splitattr(), urllib.splithost(), urllib.splitpasswd(), urllib.splitport(), urllib.splituser(), urllib.splitvalue(), and urllib.unquote().
def open_gopher | ( | self, | |
url | |||
) |
Use Gopher protocol.
Definition at line 384 of file urllib.py.
References urllib.noheaders(), gopherlib.send_query(), gopherlib.send_selector(), urllib.splitgophertype(), urllib.splithost(), urllib.splitquery(), and urllib.unquote().
def open_http | ( | self, | |
url, | |||
data = None |
|||
) |
Use HTTP protocol.
Definition at line 249 of file urllib.py.
References URLopener.addheaders, base64.encodestring(), URLopener.http_error(), urllib.proxy_bypass(), urllib.splithost(), urllib.splittype(), urllib.splituser(), string.strip(), URLopener.type, and urllib.unquote().
def open_https | ( | self, | |
url, | |||
data = None |
|||
) |
Use HTTPS protocol.
Definition at line 327 of file urllib.py.
References URLopener.addheaders, URLopener.cert_file, HTTPSConnection.cert_file, HTTPS.cert_file, base64.encodestring(), URLopener.http_error(), URLopener.key_file, HTTPSConnection.key_file, HTTPS.key_file, urllib.splithost(), urllib.splittype(), urllib.splituser(), string.strip(), URLopener.type, and urllib.unquote().
def open_local_file | ( | self, | |
url | |||
) |
Use local file.
Definition at line 407 of file urllib.py.
References rfc822.formatdate(), mimetypes.guess_type(), urllib.localhost(), URLopener.open(), urllib.splithost(), urllib.splitport(), urllib.thishost(), and urllib.url2pathname().
def open_unknown | ( | self, | |
fullurl, | |||
data = None |
|||
) |
Overridable interface to open unknown URL type.
Definition at line 184 of file urllib.py.
References urllib.splittype().
def open_unknown_proxy | ( | self, | |
proxy, | |||
fullurl, | |||
data = None |
|||
) |
Overridable interface to open unknown URL type.
Definition at line 189 of file urllib.py.
References urllib.splittype().
def retrieve | ( | self, | |
url, | |||
filename = None , |
|||
reporthook = None , |
|||
data = None |
|||
) |
retrieve(url) returns (filename, None) for a local object or (tempfilename, headers) for a remote object.
Definition at line 195 of file urllib.py.
References tempfile.mktemp(), Pattern.open, _posixfile_.open(), URLopener.open(), Template.open(), Telnet.open(), URLopener.open_local_file(), urllib.reporthook(), urllib.splitattr(), urllib.splithost(), urllib.splitquery(), urllib.splittype(), URLopener.tempcache, urllib.toBytes(), urllib.unwrap(), and urllib.url2pathname().