use 'table' as default formatter in boobank

This commit is contained in:
Romain Bignon 2010-10-16 18:59:45 +02:00
commit 3e643ef7ab
2 changed files with 6 additions and 2 deletions

View file

@ -29,6 +29,8 @@ class Boobank(ReplApplication):
VERSION = '0.3'
COPYRIGHT = 'Copyright(C) 2010 Romain Bignon, Christophe Benz'
CAPS = ICapBank
DEFAULT_FORMATTER = 'table'
COMMANDS_FORMATTERS = {'transfer': 'multiline'}
accounts = []
@ -48,9 +50,11 @@ class Boobank(ReplApplication):
tot_coming += account.coming
self.accounts.append(account)
else:
self.format((('label', 'Total'),
self.format((('id', ''),
('label', 'Total'),
('balance', tot_balance),
('coming', tot_coming)))
self.flush()
def _complete_account(self, exclude=None):
if exclude:

View file

@ -37,7 +37,7 @@ class Account(CapBaseObject):
self.add_field('label', basestring)
self.add_field('balance', float)
self.add_field('coming', float)
self.add_field('link_id', basestring)
self.link_id = None
def __repr__(self):
return u"<Account id='%s' label='%s'>" % (self.id, self.label)