From 2557b2ab5221611d03597cd8febe458619baa5fb Mon Sep 17 00:00:00 2001 From: almelid Date: Tue, 7 Jun 2011 09:30:02 +0000 Subject: [PATCH] =?UTF-8?q?Duplikater=20av=20produkter=20i=20AddStockMenu?= =?UTF-8?q?=20f=C3=B8rer=20n=C3=A5=20til=20addisjon=20av=20antall.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text_based.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text_based.py b/text_based.py index 1a9723f..2705dff 100755 --- a/text_based.py +++ b/text_based.py @@ -1185,7 +1185,7 @@ much money you're due in credits for the purchase when prompted. }[not not self.user,len(self.products) > 0]) # Read in a 'thing' (product or user): - tres = self.input_multiple(add_nonexisting=('user',), + tres = self.input_multiple(add_nonexisting=('user','product'), empty_input_permitted=True) if tres: (thing, amount) = tres @@ -1235,8 +1235,8 @@ much money you're due in credits for the purchase when prompted. else: self.user = thing elif thing in self.products.keys(): - print 'Already added this product, rewriting amount' - self.products[thing] = amount + print 'Already added this product, adding amounts' + self.products[thing] += amount else: self.products[thing] = amount