1 | # urllib2 work-alike interface |
---|
2 | # ...from urllib2... |
---|
3 | from urllib2 import \ |
---|
4 | URLError, \ |
---|
5 | HTTPError |
---|
6 | # ...and from mechanize |
---|
7 | from _opener import OpenerDirector, \ |
---|
8 | SeekableResponseOpener, \ |
---|
9 | build_opener, install_opener, urlopen |
---|
10 | from _auth import \ |
---|
11 | HTTPPasswordMgr, \ |
---|
12 | HTTPPasswordMgrWithDefaultRealm, \ |
---|
13 | AbstractBasicAuthHandler, \ |
---|
14 | AbstractDigestAuthHandler, \ |
---|
15 | HTTPProxyPasswordMgr, \ |
---|
16 | ProxyHandler, \ |
---|
17 | ProxyBasicAuthHandler, \ |
---|
18 | ProxyDigestAuthHandler, \ |
---|
19 | HTTPBasicAuthHandler, \ |
---|
20 | HTTPDigestAuthHandler, \ |
---|
21 | HTTPSClientCertMgr |
---|
22 | from _request import \ |
---|
23 | Request |
---|
24 | from _http import \ |
---|
25 | RobotExclusionError |
---|
26 | |
---|
27 | # handlers... |
---|
28 | # ...from urllib2... |
---|
29 | from urllib2 import \ |
---|
30 | BaseHandler, \ |
---|
31 | UnknownHandler, \ |
---|
32 | FTPHandler, \ |
---|
33 | CacheFTPHandler, \ |
---|
34 | FileHandler |
---|
35 | # ...and from mechanize |
---|
36 | from _http import \ |
---|
37 | HTTPHandler, \ |
---|
38 | HTTPDefaultErrorHandler, \ |
---|
39 | HTTPRedirectHandler, \ |
---|
40 | HTTPEquivProcessor, \ |
---|
41 | HTTPCookieProcessor, \ |
---|
42 | HTTPRefererProcessor, \ |
---|
43 | HTTPRefreshProcessor, \ |
---|
44 | HTTPErrorProcessor, \ |
---|
45 | HTTPRobotRulesProcessor |
---|
46 | from _upgrade import \ |
---|
47 | HTTPRequestUpgradeProcessor, \ |
---|
48 | ResponseUpgradeProcessor |
---|
49 | from _debug import \ |
---|
50 | HTTPResponseDebugProcessor, \ |
---|
51 | HTTPRedirectDebugProcessor |
---|
52 | from _seek import \ |
---|
53 | SeekableProcessor |
---|
54 | # crap ATM |
---|
55 | ## from _gzip import \ |
---|
56 | ## HTTPGzipProcessor |
---|
57 | import httplib |
---|
58 | if hasattr(httplib, 'HTTPS'): |
---|
59 | from _http import HTTPSHandler |
---|
60 | del httplib |
---|