fix boobank when coming is not available
This commit is contained in:
parent
63ae68567e
commit
d351cd13f0
3 changed files with 6 additions and 4 deletions
|
|
@ -44,7 +44,8 @@ class Boobank(ReplApplication):
|
|||
for backend, account in self.do('iter_accounts'):
|
||||
self.format(account)
|
||||
tot_balance += account.balance
|
||||
tot_coming += account.coming
|
||||
if account.coming:
|
||||
tot_coming += account.coming
|
||||
self.accounts.append(account)
|
||||
else:
|
||||
self.format((('label', 'Total'),
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
import re
|
||||
|
||||
from weboob.capabilities.bank import Account
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
from weboob.tools.browser import BasePage
|
||||
|
||||
from ..errors import PasswordExpired
|
||||
|
|
@ -58,7 +59,7 @@ class AccountsList(BasePage):
|
|||
coming = coming.replace('.','').replace(',','.')
|
||||
account.coming = float(coming)
|
||||
else:
|
||||
account.coming = 0.0
|
||||
account.coming = NotAvailable
|
||||
|
||||
l.append(account)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
from weboob.capabilities.base import NotLoaded
|
||||
from weboob.capabilities.base import NotLoaded, NotAvailable
|
||||
from .iformatter import IFormatter
|
||||
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class MultilineFormatter(IFormatter):
|
|||
def format_dict(self, item):
|
||||
result = u'\n'.join(u'%s%s' % (
|
||||
(u'%s%s' % (k, self.key_value_separator) if self.display_keys else ''), v)
|
||||
for k, v in item.iteritems() if v is not NotLoaded)
|
||||
for k, v in item.iteritems() if (v is not NotLoaded and v is not NotAvailable))
|
||||
if len(item) > 1:
|
||||
result += self.after_item
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue