all browser2 modules may import exceptions from weboob.tools.exceptions

This commit is contained in:
Romain Bignon 2014-05-17 13:58:33 +02:00
commit e434bb90e2
14 changed files with 21 additions and 20 deletions

View file

@ -19,7 +19,7 @@
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, AccountsPage

View file

@ -19,7 +19,7 @@
from weboob.tools.browser2 import LoginBrowser, need_login, URL
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, IndexPage, AccountsPage, OperationsPage

View file

@ -19,7 +19,7 @@
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, HomePage, TransactionsPage

View file

@ -22,7 +22,7 @@ from weboob.capabilities.bank import Account, Transaction
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword
from weboob.capabilities.base import NotAvailable
from weboob.tools.browser import BrowserIncorrectPassword, BrokenPageError
from weboob.tools.exceptions import BrowserIncorrectPassword, ParseError
from weboob.tools.browser2 import BaseBrowser
from re import match, compile, sub
@ -124,9 +124,9 @@ class CmbBackend(BaseBackend, ICapBank):
tree = etree.parse(StringIO(data), parser)
table = tree.xpath('/html/body/table')
if len(table) == 0:
raise BrokenPageError()
raise ParseError()
else:
raise BrokenPageError()
raise ParseError()
for tr in tree.xpath('/html/body//table[contains(@class, "Tb")]/tr'):
if tr.get('class', None) not in ('LnTit', 'LnTot', 'LnMnTiers', None):
@ -196,9 +196,9 @@ class CmbBackend(BaseBackend, ICapBank):
tree = etree.parse(StringIO(data), parser)
tables = tree.xpath('/html/body/table')
if len(tables) == 0:
raise BrokenPageError()
raise ParseError()
else:
raise BrokenPageError()
raise ParseError()
i = 0

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import HomePage, LoginPage, HistoryPage, DetailsPage
__all__ = ['Freemobile']

View file

@ -19,7 +19,7 @@
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import LoginPage, LoginErrorPage, AvoirPage, OperationsTraiteesPage, OperationsFuturesPage

View file

@ -22,7 +22,7 @@ import ssl
from datetime import timedelta
from weboob.tools.date import LinearDateGuesser
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from .pages import AccountsPage, CBOperationPage, CPTOperationPage, LoginPage

View file

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

View file

@ -19,7 +19,7 @@
import hashlib
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword, BrokenPageError
from weboob.tools.exceptions import BrowserIncorrectPassword, ParseError
from weboob.capabilities.bank import Account, TransferError
from .pages import AccountsList, LoginPage, TitrePage, TitreHistory,\
@ -162,7 +162,7 @@ class IngBrowser(LoginBrowser):
self.valtransferpage.go()
recap = self.page.recap()
if len(list(recap)) == 0:
raise BrokenPageError('Unable to find confirmation')
raise ParseError('Unable to find confirmation')
return self.page.recap()
else:
raise TransferError('Recipient not found')

View file

@ -19,7 +19,7 @@
from StringIO import StringIO
from weboob.tools.browser import BasePage, BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from weboob.tools.captcha.virtkeyboard import VirtKeyboard
from weboob.tools.browser2.page import HTMLPage
@ -120,5 +120,5 @@ class LoginPage(HTMLPage):
form.submit()
class StopPage(BasePage):
class StopPage(HTMLPage):
pass

View file

@ -18,9 +18,10 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from .pages import HomePage, LoginPage, HistoryPage, BillsPage, ErrorPage
__all__ = ['PoivyBrowser']

View file

@ -17,7 +17,7 @@
# 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 weboob.tools.browser import BrowserBanned
from weboob.tools.exceptions import BrowserBanned
from weboob.tools.browser2.page import HTMLPage, LoggedPage, method, ListElement, ItemElement, pagination
from weboob.tools.browser2.filters import CleanText, CleanDecimal, Field, Attr, DateTime, Link, Format
from weboob.capabilities.bill import Subscription, Detail

View file

@ -26,7 +26,7 @@ from weboob.capabilities.bugtracker import ICapBugTracker, Issue, Project, User,
Query, Change
from weboob.capabilities.collection import ICapCollection, Collection, CollectionNotFound
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.browser import BrowserHTTPNotFound
from weboob.tools.exceptions import BrowserHTTPNotFound
from weboob.tools.value import ValueBackendPassword, Value
from .browser import RedmineBrowser

View file

@ -21,7 +21,7 @@
import re
from weboob.tools.browser2 import DomainBrowser, HTMLPage, Profile
from weboob.tools.browser import BrowserIncorrectPassword
from weboob.tools.exceptions import BrowserIncorrectPassword
from weboob.tools.json import json