From: Tim Deegan Date: Mon, 22 Jan 2007 11:49:05 +0000 (+0000) Subject: [PYGRUB] Don't redraw the interactive menu screen if it doesn't need it. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15371^2~119 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5ba43a5774a07d778e1fe3adad6ecaf434468649;p=xen.git [PYGRUB] Don't redraw the interactive menu screen if it doesn't need it. Signed-off-by: Tim Deegan --- 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