aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@xensource.com>2007-01-22 11:49:05 +0000
committerTim Deegan <Tim.Deegan@xensource.com>2007-01-22 11:49:05 +0000
commit5ba43a5774a07d778e1fe3adad6ecaf434468649 (patch)
treeb868f660cb05ff22ff1ed74c4f7bed08a90d13b4 /tools/pygrub
parent8b8c4769ed9406d2bd8753bc0d829c176c8dedde (diff)
downloadxen-5ba43a5774a07d778e1fe3adad6ecaf434468649.tar.gz
xen-5ba43a5774a07d778e1fe3adad6ecaf434468649.tar.bz2
xen-5ba43a5774a07d778e1fe3adad6ecaf434468649.zip
[PYGRUB] Don't redraw the interactive menu screen if it doesn't need it.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Diffstat (limited to 'tools/pygrub')
-rw-r--r--tools/pygrub/src/pygrub20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index e28c19804a..c0204da32e 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -400,14 +400,20 @@ class Grub:
%(int(timeout) - mytime))
else:
self.screen.addstr(20, 5, " " * 80)
-
self.fill_entry_list()
+
c = self.screen.getch()
- if mytime != -1:
- mytime += 1
- if mytime >= int(timeout):
- self.isdone = True
- break
+ if c == -1:
+ # Timed out waiting for a keypress
+ if mytime != -1:
+ mytime += 1
+ if mytime >= int(timeout):
+ self.isdone = True
+ break
+ else:
+ # received a keypress: stop the timer
+ mytime = -1
+ self.screen.timeout(-1)
# handle keypresses
if c == ord('c'):
@@ -432,10 +438,8 @@ class Grub:
self.isdone = True
break
elif c == curses.KEY_UP:
- mytime = -1
self.selected_image -= 1
elif c == curses.KEY_DOWN:
- mytime = -1
self.selected_image += 1
# elif c in (ord('q'), 27): # 27 == esc
# self.selected_image = -1