pyflakes fixes (unused imports)

This commit is contained in:
Romain Bignon 2013-07-14 19:06:48 +02:00
commit 979f1764d4
6 changed files with 27 additions and 36 deletions

View file

@ -22,7 +22,6 @@
import urllib
import mechanize
from datetime import datetime
from logging import warning
from weboob.tools.browser import BaseBrowser, BrowserIncorrectPassword, BrowserPasswordExpired
from weboob.capabilities.bank import TransferError, Transfer
@ -84,14 +83,14 @@ class HelloBank(BaseBrowser):
now = datetime.now()
self.location('/NS_VIRDF?Origine=DSP_VIR&stp=%s' % now.strftime("%Y%m%d%H%M%S"))
accounts = self.page.get_accounts()
accounts = self.page.get_accounts()
if len(accounts) == 0:
print 'no accounts'
# oops, no accounts? check if we have not exhausted the allowed use
# of this password
for img in self.document.getroot().cssselect('img[align="middle"]'):
if img.attrib.get('alt', '') == 'Changez votre code secret':
raise BrowserPasswordExpired('Your password has expired')
raise BrowserPasswordExpired('Your password has expired')
self.location('/NSFR?Action=DSP_VGLOBALE')
return self.page.get_list(accounts)
@ -108,7 +107,7 @@ class HelloBank(BaseBrowser):
def get_IBAN_from_account(self, account):
self.go_to_history_page(account)
return self.page.get_IBAN()
def go_to_history_page(self,account):
if account._link_id is None:
return iter([])
@ -127,17 +126,17 @@ class HelloBank(BaseBrowser):
'pageId': 'releveoperations',
'sendEUD': 'true',
}
self.location('/udc', urllib.urlencode(data))
self.location('/udc', urllib.urlencode(data))
return None
def go_to_coming_operations_page(self,account):
if account._link_id is None:
return iter([])
if not self.is_on_page(AccountsList):
self.location('/NSFR?Action=DSP_VGLOBALE')
data = {'gt': 'homepage:basic-theme',
'externalIAId': 'IAStatements',
'cboFlowName': 'flow/iastatement',
@ -149,10 +148,10 @@ class HelloBank(BaseBrowser):
'pageId': 'mouvementsavenir',
'sendEUD': 'true',
}
self.location('/udc', urllib.urlencode(data))
self.location('/udc', urllib.urlencode(data))
return None
def iter_history(self, account):
self.go_to_history_page(account)
return self.page.iter_operations()
@ -178,7 +177,7 @@ class HelloBank(BaseBrowser):
html, [("Content-Type", "text/html")],
"https://client.hellobank.fr/NS_VIRDF", 200, "OK")
self.set_response(response)
accounts = self.page.get_accounts()
self.page.transfer(from_id, to_id, amount, reason)

View file

@ -19,15 +19,12 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
import re
from decimal import Decimal
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
from weboob.capabilities.bank import Account
from weboob.capabilities.base import NotAvailable
from weboob.tools.browser import BasePage, BrokenPageError, BrowserPasswordExpired
from weboob.tools.browser import BasePage, BrowserPasswordExpired
from weboob.tools.json import json
import unicodedata as ud
__all__ = ['AccountsList', 'AccountPrelevement']
@ -43,7 +40,7 @@ class AccountsList(BasePage):
def on_loaded(self):
pass
def get_list(self, accounts_ids):
l = []
# Read the json data
@ -60,13 +57,13 @@ class AccountsList(BasePage):
account.type = self.ACCOUNT_TYPES.get(id_famille, Account.TYPE_UNKNOWN)
account.id = 0
account._link_id = 'KEY'+compte['key']
# IBAN aren't in JSON
# Fast method, get it from transfer page.
for i,a in accounts_ids.items():
if a.label == account.label:
account.id = i
# But it's doesn't work with LOAN and MARKET, so use slow method : Get it from transaction page.
# But it's doesn't work with LOAN and MARKET, so use slow method : Get it from transaction page.
if account.id == 0:
account.id = self.browser.get_IBAN_from_account(account)
l.append(account)

View file

@ -21,13 +21,12 @@
import time
import re
from weboob.tools.mech import ClientForm
import urllib
from weboob.tools.browser import BasePage, BrowserUnavailable
from weboob.tools.captcha.virtkeyboard import VirtKeyboard,VirtKeyboardError
__all__ = ['LoginPage', 'ConfirmPage', 'ChangePasswordPage']
__all__ = ['LoginPage', 'ConfirmPage', 'InfoMessagePage']
class HelloBankVirtKeyboard(VirtKeyboard):
@ -60,7 +59,7 @@ class HelloBankVirtKeyboard(VirtKeyboard):
coords["08"] = (185,100,203,121)
coords["09"] = (262,100,280,121)
coords["10"] = (339,100,357,121)
VirtKeyboard.__init__(self,basepage.browser.openurl(self.url % time.time()),coords,self.color)
self.check_symbols(self.symbols,basepage.browser.responses_dirname)
@ -90,7 +89,7 @@ class LoginPage(BasePage):
except VirtKeyboardError,err:
self.logger.error("Error: %s"%err)
return False
self.browser.select_form('logincanalnet')
self.browser.set_all_readonly(False)
self.browser['ch1'] = login.encode('utf-8')

View file

@ -30,4 +30,4 @@ class AccountPrelevement(AccountsList):
__all__ = ['AccountsList', 'LoginPage',
'AccountPrelevement', 'TransferPage', 'TransferConfirmPage',
'BillsPage', 'StopPage']
'BillsPage', 'StopPage', 'TitrePage']

View file

@ -20,8 +20,7 @@
from decimal import Decimal
from weboob.capabilities.bank import Account, Investment
from weboob.capabilities.base import NotAvailable
from weboob.capabilities.bank import Investment
from weboob.tools.browser import BasePage
from weboob.tools.capabilities.bank.transactions import FrenchTransaction

View file

@ -17,15 +17,12 @@
# 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 PyQt4.QtGui import QListWidgetItem, QImage, QPixmap, QLabel, QIcon, QBrush, QColor
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QListWidgetItem
from PyQt4.QtCore import SIGNAL
from decimal import Decimal
from weboob.tools.application.qt import QtMainWindow, QtDo, HTMLDelegate
from weboob.tools.application.qt import QtMainWindow, QtDo
from weboob.tools.application.qt.backendcfg import BackendCfg
from weboob.capabilities.job import ICapJob, BaseJobAdvert
from weboob.capabilities.base import NotLoaded, NotAvailable
from weboob.capabilities.job import ICapJob
from .ui.main_window_ui import Ui_MainWindow
@ -86,7 +83,7 @@ class MainWindow(QtMainWindow):
QtMainWindow.closeEvent(self, event)
def backendsConfig(self):
bckndcfg = BackendCfg(self.weboob, (ICapJob,), self)
bckndcfg = BackendCfg(self.weboob, (ICapJob,), self)
if bckndcfg.run():
pass