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-devel

Re: [Xen-devel] [PATCH][RESEND] fix two pygrub problems

To: John Levon <john.levon@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RESEND] fix two pygrub problems
From: Christian Limpach <christian.limpach@xxxxxxxxx>
Date: Tue, 7 Feb 2006 20:47:09 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 07 Feb 2006 20:58:10 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kfohssd6Ot2QVTubmO31ebq1N6kA90IWKjbfC3t/BCpAq3aZiH/564NFUHBz4gbYadcrKbyw165ibwoxwHoLJ9Xywj+kEmpbNLXwnyT7s7hyuWtGZBW8MYBnQvrzejuE8mzJ/a46jcYn+VAf48f2DHEJ7eyT8UOG2rO1enMD6zY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20060207101534.GA22943@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060207101534.GA22943@xxxxxxxxxxxxxxxxx>
Reply-to: Christian.Limpach@xxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks!

On 2/7/06, John Levon <john.levon@xxxxxxx> wrote:
>
> # HG changeset patch
> # User john.levon@xxxxxxx
> # Node ID d68796f82e99e68750a2212fef57d61e65f9afb9
> # Parent  5b004f4e76cf90ef6f7155a4822e63b9e33cf7d8
> 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 5b004f4e76cf -r d68796f82e99 tools/pygrub/src/pygrub
> --- a/tools/pygrub/src/pygrub   Wed Jan 25 23:35:22 2006 +0100
> +++ b/tools/pygrub/src/pygrub   Thu Jan 26 06:24:50 2006 -0800
> @@ -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-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

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

<Prev in Thread] Current Thread [Next in Thread>