From 666c301e146b1ca9e05f26365ee8a4db9c43e819 Mon Sep 17 00:00:00 2001 From: oysteini Date: Wed, 24 Nov 2010 16:22:10 +0000 Subject: [PATCH] Advarsel for brukere med lav kreditt. --- text_based.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/text_based.py b/text_based.py index 91223db..f78758b 100755 --- a/text_based.py +++ b/text_based.py @@ -17,6 +17,8 @@ local_help_commands = ['help!', '???'] faq_commands = ['faq'] restart_commands = ['restart'] +low_credit_warning_limit = -100 + class ExitMenu(Exception): pass @@ -792,6 +794,9 @@ When finished, write an empty line to confirm the purchase. self.print_purchase() for t in self.purchase.transactions: print 'User %s\'s credit is now %d kr' % (t.user.name, t.user.credit) + if t.user.credit < low_credit_warning_limit: + print ('USER %s HAS LOWER CREDIT THAN %d, AND SHOULD CONSIDER PUTTING SOME MONEY IN THE BOX.' + % (t.user.name, low_credit_warning_limit)) self.pause() return True