source: py-scraping/mechanize/__init__.py@ 178

Last change on this file since 178 was 106, checked in by Rick van der Zwet, 15 years ago

Initial commit...

File size: 3.7 KB
RevLine 
[106]1__all__ = [
2 'AbstractBasicAuthHandler',
3 'AbstractDigestAuthHandler',
4 'BaseHandler',
5 'Browser',
6 'BrowserStateError',
7 'CacheFTPHandler',
8 'ContentTooShortError',
9 'Cookie',
10 'CookieJar',
11 'CookiePolicy',
12 'DefaultCookiePolicy',
13 'DefaultFactory',
14 'FTPHandler',
15 'Factory',
16 'FileCookieJar',
17 'FileHandler',
18 'FormNotFoundError',
19 'FormsFactory',
20 'HTTPBasicAuthHandler',
21 'HTTPCookieProcessor',
22 'HTTPDefaultErrorHandler',
23 'HTTPDigestAuthHandler',
24 'HTTPEquivProcessor',
25 'HTTPError',
26 'HTTPErrorProcessor',
27 'HTTPHandler',
28 'HTTPPasswordMgr',
29 'HTTPPasswordMgrWithDefaultRealm',
30 'HTTPProxyPasswordMgr',
31 'HTTPRedirectDebugProcessor',
32 'HTTPRedirectHandler',
33 'HTTPRefererProcessor',
34 'HTTPRefreshProcessor',
35 'HTTPRequestUpgradeProcessor',
36 'HTTPResponseDebugProcessor',
37 'HTTPRobotRulesProcessor',
38 'HTTPSClientCertMgr',
39 'HTTPSHandler',
40 'HeadParser',
41 'History',
42 'LWPCookieJar',
43 'Link',
44 'LinkNotFoundError',
45 'LinksFactory',
46 'LoadError',
47 'MSIECookieJar',
48 'MozillaCookieJar',
49 'OpenerDirector',
50 'OpenerFactory',
51 'ParseError',
52 'ProxyBasicAuthHandler',
53 'ProxyDigestAuthHandler',
54 'ProxyHandler',
55 'Request',
56 'ResponseUpgradeProcessor',
57 'RobotExclusionError',
58 'RobustFactory',
59 'RobustFormsFactory',
60 'RobustLinksFactory',
61 'RobustTitleFactory',
62 'SeekableProcessor',
63 'SeekableResponseOpener',
64 'TitleFactory',
65 'URLError',
66 'USE_BARE_EXCEPT',
67 'UnknownHandler',
68 'UserAgent',
69 'UserAgentBase',
70 'XHTMLCompatibleHeadParser',
71 '__version__',
72 'build_opener',
73 'install_opener',
74 'lwp_cookie_str',
75 'make_response',
76 'request_host',
77 'response_seek_wrapper', # XXX deprecate in public interface?
78 'seek_wrapped_response' # XXX should probably use this internally in place of response_seek_wrapper()
79 'str2time',
80 'urlopen',
81 'urlretrieve']
82
83import logging
84import sys
85
86from _mechanize import __version__
87
88# high-level stateful browser-style interface
89from _mechanize import \
90 Browser, History, \
91 BrowserStateError, LinkNotFoundError, FormNotFoundError
92
93# configurable URL-opener interface
94from _useragent import UserAgentBase, UserAgent
95from _html import \
96 ParseError, \
97 Link, \
98 Factory, DefaultFactory, RobustFactory, \
99 FormsFactory, LinksFactory, TitleFactory, \
100 RobustFormsFactory, RobustLinksFactory, RobustTitleFactory
101
102# urllib2 work-alike interface (part from mechanize, part from urllib2)
103# This is a superset of the urllib2 interface.
104from _urllib2 import *
105
106# misc
107from _opener import ContentTooShortError, OpenerFactory, urlretrieve
108from _util import http2time as str2time
109from _response import \
110 response_seek_wrapper, seek_wrapped_response, make_response
111from _http import HeadParser
112try:
113 from _http import XHTMLCompatibleHeadParser
114except ImportError:
115 pass
116
117# cookies
118from _clientcookie import Cookie, CookiePolicy, DefaultCookiePolicy, \
119 CookieJar, FileCookieJar, LoadError, request_host_lc as request_host, \
120 effective_request_host
121from _lwpcookiejar import LWPCookieJar, lwp_cookie_str
122# 2.4 raises SyntaxError due to generator / try/finally use
123if sys.version_info[:2] > (2, 4):
124 try:
125 import sqlite3
126 except ImportError:
127 pass
128 else:
129 from _firefox3cookiejar import Firefox3CookieJar
130from _mozillacookiejar import MozillaCookieJar
131from _msiecookiejar import MSIECookieJar
132
133# If you hate the idea of turning bugs into warnings, do:
134# import mechanize; mechanize.USE_BARE_EXCEPT = False
135USE_BARE_EXCEPT = True
136
137logger = logging.getLogger("mechanize")
138if logger.level is logging.NOTSET:
139 logger.setLevel(logging.CRITICAL)
140del logger
Note: See TracBrowser for help on using the repository browser.