move browser exceptions into weboob.tools.exceptions

This commit is contained in:
Romain Bignon 2014-05-17 13:31:46 +02:00
commit 7c1e08eb96
5 changed files with 54 additions and 34 deletions

View file

@ -22,7 +22,7 @@ from urlparse import urlsplit, parse_qsl, urlparse
from datetime import datetime, timedelta
from weboob.tools.browser2 import LoginBrowser, URL, Wget, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from weboob.capabilities.bank import Transfer, TransferError
from .pages import LoginPage, LoginErrorPage, AccountsPage, UserSpacePage, \

View file

@ -25,7 +25,7 @@ from dateutil.relativedelta import relativedelta
from weboob.tools.browser2.page import HTMLPage, method, ListElement, ItemElement, SkipItem, FormNotFound, LoggedPage
from weboob.tools.browser2.filters import Filter, Env, CleanText, CleanDecimal, Link, Field, TableCell
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from weboob.capabilities import NotAvailable
from weboob.capabilities.bank import Account
from weboob.tools.capabilities.bank.transactions import FrenchTransaction

View file

@ -34,7 +34,7 @@ from weboob.capabilities.account import ICapAccount, Account, AccountRegisterErr
from weboob.core.backendscfg import BackendAlreadyExists
from weboob.core.modules import ModuleLoadError
from weboob.core.repositories import ModuleInstallError
from weboob.tools.browser import BrowserUnavailable, BrowserIncorrectPassword, BrowserForbidden
from weboob.tools.exceptions import BrowserUnavailable, BrowserIncorrectPassword, BrowserForbidden
from weboob.tools.value import Value, ValueBool, ValueFloat, ValueInt, ValueBackendPassword
from weboob.tools.misc import to_unicode
from weboob.tools.ordereddict import OrderedDict

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
# Copyright(C) 2010-2014 Romain Bignon
#
# This file is part of weboob.
#
@ -45,6 +45,7 @@ from contextlib import closing
from gzip import GzipFile
import warnings
from weboob.tools.exceptions import BrowserUnavailable, BrowserIncorrectPassword, BrowserPasswordExpired, BrowserForbidden, BrowserBanned, BrowserHTTPNotFound, BrowserHTTPError
from weboob.tools.decorators import retry
from weboob.tools.log import getLogger
from weboob.tools.mech import ClientForm
@ -62,39 +63,10 @@ else:
__all__ = ['BrowserIncorrectPassword', 'BrowserForbidden', 'BrowserBanned', 'BrowserUnavailable', 'BrowserRetry',
'BrowserHTTPNotFound', 'BrowserHTTPError', 'BrokenPageError', 'BasePage',
'BrowserPasswordExpired', 'BrowserHTTPNotFound', 'BrowserHTTPError', 'BrokenPageError', 'BasePage',
'StandardBrowser', 'BaseBrowser']
# Exceptions
class BrowserIncorrectPassword(Exception):
pass
class BrowserForbidden(Exception):
pass
class BrowserBanned(BrowserIncorrectPassword):
pass
class BrowserPasswordExpired(BrowserIncorrectPassword):
pass
class BrowserUnavailable(Exception):
pass
class BrowserHTTPNotFound(BrowserUnavailable):
pass
class BrowserHTTPError(BrowserUnavailable):
pass
class BrowserRetry(Exception):
pass

View file

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
class BrowserIncorrectPassword(Exception):
pass
class BrowserForbidden(Exception):
pass
class BrowserBanned(BrowserIncorrectPassword):
pass
class BrowserPasswordExpired(BrowserIncorrectPassword):
pass
class BrowserUnavailable(Exception):
pass
class BrowserHTTPNotFound(BrowserUnavailable):
pass
class BrowserHTTPError(BrowserUnavailable):
pass