From 29f5c42513ee83613f41467a8315000611713531 Mon Sep 17 00:00:00 2001 From: oysteini Date: Fri, 4 Jun 2010 21:07:47 +0000 Subject: [PATCH] =?UTF-8?q?Fikset=20printing=20av=20menyer=20s=C3=A5=20det?= =?UTF-8?q?=20ser=20greit=20ut=20med=20mer=20enn=20ti=20elementer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text_based.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text_based.py b/text_based.py index c178781..8e02cf4 100755 --- a/text_based.py +++ b/text_based.py @@ -349,6 +349,7 @@ it by putting money in the box and using the "Adjust credit" menu. self.session = None def _execute(self): + line_format = '%' + str(len(str(len(self.items)))) + 'd ) %s' while True: self.print_header() self.set_context(None) @@ -357,7 +358,7 @@ it by putting money in the box and using the "Adjust credit" menu. self.pause() return None for i in range(len(self.items)): - self.printc('%d ) %s' % (i+1, self.item_name(i))) + self.printc(line_format % (i+1, self.item_name(i))) item_i = self.input_int(self.prompt, (1,len(self.items)))-1 if self.item_is_submenu(item_i): self.items[item_i].execute()