WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix pygrub to handle timeout of -1 (wait forever).

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix pygrub to handle timeout of -1 (wait forever).
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 07 Feb 2006 23:56:07 +0000
Delivery-date: Wed, 08 Feb 2006 00:07:53 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User john.levon@xxxxxxx
# Node ID 859c8d66b203134180820d694191731d2c195336
# Parent  e9d78d8bd568d4be0461bb5b09007fd2ccc4a707
Fix pygrub to handle timeout of -1 (wait forever).
Only call use_default_colors() if it's available.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff -r e9d78d8bd568 -r 859c8d66b203 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Tue Feb  7 20:38:44 2006
+++ b/tools/pygrub/src/pygrub   Tue Feb  7 20:46:13 2006
@@ -29,7 +29,8 @@
 
 def draw_window():
     stdscr = curses.initscr()
-    curses.use_default_colors()
+    if hasattr(curses, 'use_default_colors'):
+        curses.use_default_colors()
     try:
         curses.curs_set(0)
     except _curses.error:
@@ -152,15 +153,16 @@
 
 def main(cf = None):
     mytime = 0
+    timeout = int(cf.timeout)
 
     (stdscr, win) = draw_window()
     stdscr.timeout(1000)
     selected = cf.default
     
-    while (mytime < int(cf.timeout)):
-        if cf.timeout != -1 and mytime != -1: 
+    while (timeout == -1 or mytime < int(timeout)):
+        if timeout != -1 and mytime != -1: 
             stdscr.addstr(20, 5, "Will boot selected entry in %2d seconds"
-                          %(int(cf.timeout) - mytime))
+                          %(int(timeout) - mytime))
         else:
             stdscr.addstr(20, 5, " " * 80)
             

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix pygrub to handle timeout of -1 (wait forever)., Xen patchbot -unstable <=