Bruker less i brukerlisten.

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2010-11-24 16:15:12 +00:00
parent 4b686894e4
commit 04b7f0dfe3
1 changed files with 9 additions and 8 deletions

View File

@ -725,15 +725,16 @@ class UserListMenu(Menu):
user_list = self.session.query(User).all() user_list = self.session.query(User).all()
total_credit = self.session.query(sqlalchemy.func.sum(User.credit)).first()[0] total_credit = self.session.query(sqlalchemy.func.sum(User.credit)).first()[0]
line_format = '%-12s | %6s' line_format = '%-12s | %6s\n'
hline = '---------------------' hline = '---------------------\n'
print line_format % ('username', 'credit') text = ''
print hline text += line_format % ('username', 'credit')
text += hline
for user in user_list: for user in user_list:
print line_format % (user.name, user.credit) text += line_format % (user.name, user.credit)
print hline text += hline
print line_format % ('total credit', total_credit) text += line_format % ('total credit', total_credit)
self.pause() less(text)
class BuyMenu(Menu): class BuyMenu(Menu):