Rename BaseBrowser to Browser

This commit is contained in:
Florent 2014-09-23 10:53:38 +02:00
commit 0088013ae1
132 changed files with 348 additions and 348 deletions

View file

@ -17,9 +17,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .browser import BaseBrowser, DomainBrowser, Wget, Firefox, UrlNotAllowed, Profile
from .browser import Browser, DomainBrowser, Wget, Firefox, UrlNotAllowed, Profile
from .page import PagesBrowser, Page, URL, HTMLPage, LoginBrowser, need_login, JsonPage, LoggedPage, XMLPage
__all__ = ['BaseBrowser', 'DomainBrowser', 'Wget', 'Firefox', 'UrlNotAllowed', 'Profile', 'XMLPage',
__all__ = ['Browser', 'DomainBrowser', 'Wget', 'Firefox', 'UrlNotAllowed', 'Profile', 'XMLPage',
'PagesBrowser', 'Page', 'URL', 'HTMLPage', 'LoginBrowser', 'need_login', 'JsonPage', 'LoggedPage']

View file

@ -116,7 +116,7 @@ class Wget(Profile):
'User-Agent': 'Wget/%s' % self.version})
class BaseBrowser(object):
class Browser(object):
"""
Simple browser class.
Act like a browser, and don't try to do too much.
@ -295,7 +295,7 @@ class BaseBrowser(object):
For example:
>>> BaseBrowser().open('http://google.com', async=True).result().text # doctest: +SKIP
>>> Browser().open('http://google.com', async=True).result().text # doctest: +SKIP
:param url: URL
:type url: str
@ -496,7 +496,7 @@ class UrlNotAllowed(Exception):
"""
class DomainBrowser(BaseBrowser):
class DomainBrowser(Browser):
"""
A browser that handles relative URLs and can have a base URL (usually a domain).
@ -559,7 +559,7 @@ class DomainBrowser(BaseBrowser):
def open(self, req, *args, **kwargs):
"""
Like :meth:`BaseBrowser.open` but hanldes urls without domains, using
Like :meth:`Browser.open` but hanldes urls without domains, using
the :attr:`BASEURL` attribute.
"""
uri = req.url if isinstance(req, requests.Request) else req

View file

@ -287,7 +287,7 @@ class PagesBrowser(DomainBrowser):
callback = kwargs.pop('callback', lambda response: response)
# Have to define a callback to seamlessly process synchronous and
# asynchronous requests, see :meth:`BaseBrowser.open` and its `async`
# asynchronous requests, see :meth:`Browser.open` and its `async`
# and `callback` params.
def internal_callback(response):
# Try to handle the response page with an URL instance.
@ -309,7 +309,7 @@ class PagesBrowser(DomainBrowser):
def location(self, *args, **kwargs):
"""
Same method than
:meth:`weboob.tools.browser2.browser.BaseBrowser.location`, but if the
:meth:`weboob.tools.browser2.browser.Browser.location`, but if the
url matches any :class:`URL` object, an attribute `page` is added to
response, and the attribute :attr:`PagesBrowser.page` is set.
"""