display error if wrong password
This commit is contained in:
parent
6e8d36ca93
commit
3225bcb639
1 changed files with 11 additions and 8 deletions
|
|
@ -25,6 +25,7 @@ from __future__ import with_statement
|
||||||
import sys
|
import sys
|
||||||
from types import MethodType
|
from types import MethodType
|
||||||
|
|
||||||
|
import weboob
|
||||||
from weboob.capabilities.bank import ICapBank, AccountNotFound
|
from weboob.capabilities.bank import ICapBank, AccountNotFound
|
||||||
from weboob.tools.application import ConsoleApplication
|
from weboob.tools.application import ConsoleApplication
|
||||||
|
|
||||||
|
|
@ -38,15 +39,17 @@ class Boobank(ConsoleApplication):
|
||||||
|
|
||||||
@ConsoleApplication.command('List every available accounts')
|
@ConsoleApplication.command('List every available accounts')
|
||||||
def command_list(self):
|
def command_list(self):
|
||||||
print ' ID Account Balance Coming '
|
lines = [' ID Account Balance Coming ',
|
||||||
print '+-----------------+---------------------+--------------+-------------+'
|
'+-----------------+---------------------+--------------+-------------+']
|
||||||
|
|
||||||
for name, backend, in self.weboob.iter_backends():
|
for name, backend, in self.weboob.iter_backends():
|
||||||
for account in backend.iter_accounts():
|
try:
|
||||||
print '%17s %-20s %11.2f %11.2f' % (account.id,
|
for account in backend.iter_accounts():
|
||||||
account.label,
|
lines.append('%17s %-20s %11.2f %11.2f' % (
|
||||||
account.balance,
|
account.id, account.label, account.balance, account.coming))
|
||||||
account.coming)
|
except weboob.tools.browser.BrowserIncorrectPassword:
|
||||||
|
print >>sys.stderr, 'Error: Incorrect password for backend %s' % name
|
||||||
|
return 1
|
||||||
|
print '\n'.join(lines)
|
||||||
|
|
||||||
@ConsoleApplication.command('Display all future operations')
|
@ConsoleApplication.command('Display all future operations')
|
||||||
def command_coming(self, id):
|
def command_coming(self, id):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue