Rev 573 | Rev 626 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 573 | Rev 604 | ||
|---|---|---|---|
| Line 78... | Line 78... | ||
| 78 | sys.stdout.write('Enter choice number[%d]: ' % defopt) |
78 | sys.stdout.write('Enter choice number[%d]: ' % defopt) |
| 79 | else: |
79 | else: |
| 80 | sys.stdout.write('Enter choice number: ') |
80 | sys.stdout.write('Enter choice number: ') |
| 81 | 81 | ||
| 82 | def menu(self, text, choices, button, defopt=None): |
82 | def menu(self, text, choices, button, defopt=None): |
| - | 83 | self.title = 'Main menu' |
|
| 83 | menu = [] |
84 | menu = [] |
| 84 | for key, descr in choices: |
85 | for key, descr in choices: |
| 85 | txt = key + (45-len(key))*' ' + ': ' + descr |
86 | txt = key + (45-len(key))*' ' + ': ' + descr |
| 86 | menu.append((key, txt)) |
87 | menu.append((key, txt)) |
| 87 | 88 | ||
| Line 175... | Line 176... | ||
| 175 | if res == 0: |
176 | if res == 0: |
| 176 | return 'y' |
177 | return 'y' |
| 177 | return 'n' |
178 | return 'n' |
| 178 | 179 | ||
| 179 | def menu(self, text, choices, button, defopt=None): |
180 | def menu(self, text, choices, button, defopt=None): |
| - | 181 | self.title = 'Main menu' |
|
| 180 | text = text + ':' |
182 | text = text + ':' |
| 181 | width = '70' |
183 | width = '70' |
| 182 | height = str(8 + len(choices)) |
184 | height = str(8 + len(choices)) |
| 183 | args = [] |
185 | args = [] |
| 184 | for key,val in choices: |
186 | for key,val in choices: |