Transaksjonslisten i ShowUserMenu begrenset til siste 20.
This commit is contained in:
parent
90283a81b5
commit
0b36fa75d1
|
@ -299,11 +299,15 @@ class ShowUserMenu(Menu):
|
||||||
self.pause()
|
self.pause()
|
||||||
|
|
||||||
def print_transactions(self, user):
|
def print_transactions(self, user):
|
||||||
|
limit = 20
|
||||||
if len(user.transactions) == 0:
|
if len(user.transactions) == 0:
|
||||||
print 'No transactions'
|
print 'No transactions'
|
||||||
return
|
return
|
||||||
print 'Transactions:'
|
if len(user.transactions) <= limit:
|
||||||
for t in user.transactions:
|
print 'Transactions:'
|
||||||
|
else:
|
||||||
|
print 'Transactions (last %d):' % limit
|
||||||
|
for t in user.transactions[-limit:]:
|
||||||
string = ' * %s: %s %d kr, ' % \
|
string = ' * %s: %s %d kr, ' % \
|
||||||
(t.time.strftime('%Y-%m-%d %H:%M'),
|
(t.time.strftime('%Y-%m-%d %H:%M'),
|
||||||
{True:'in', False:'out'}[t.amount<0],
|
{True:'in', False:'out'}[t.amount<0],
|
||||||
|
|
Loading…
Reference in New Issue