This commit is contained in:
parent
910c446a2f
commit
bddaf5e7e9
|
@ -163,6 +163,10 @@ class Menu():
|
|||
prompt = self.prompt
|
||||
while True:
|
||||
result = self.input_str(prompt)
|
||||
if result == '':
|
||||
print 'Please enter something'
|
||||
|
||||
else:
|
||||
try:
|
||||
choice = int(result)
|
||||
if (choice > 0 and choice <= number_of_choices):
|
||||
|
@ -950,10 +954,10 @@ class ProductListMenu(Menu):
|
|||
total_value += p.price*p.stock
|
||||
line_format = '%-15s | %5s | %-'+str(Product.name_length)+'s | %5s \n'
|
||||
text += line_format % ('bar code', 'price', 'name', 'stock')
|
||||
text += '-----------------------------------------------------------------------\n'
|
||||
text += '-------------------------------------------------------------------------------\n'
|
||||
for p in product_list:
|
||||
text += line_format % (p.bar_code, p.price, p.name, p.stock)
|
||||
text += '-----------------------------------------------------------------------\n'
|
||||
text += '-------------------------------------------------------------------------------\n'
|
||||
text += line_format % ('Total value',total_value,'','', )
|
||||
less(text)
|
||||
|
||||
|
|
Loading…
Reference in New Issue