[PATCHv2] Give users way to select DD ISO interactively (#1036765)

Brian C. Lane bcl at redhat.com
Tue Jan 21 19:10:13 UTC 2014


On Tue, Jan 21, 2014 at 03:37:25PM +0100, Vratislav Podzimek wrote:
> +def selection_menu(items, title, info_func, multi_choice=True):

[snip]

>      page_length = 20
>      page = 1
> +    if multi_choice:
> +        choice_format = "[%s]"
> +    else:
> +        choice_format = ""
> +    format_str = "%3d) " + choice_format + " %s"
> +
>      while True:
>          # show a page of drivers
> -        print("\nPage %d of %d" % (page, 1 + (len(drivers) / page_length)))
> -        print("Select drivers to install")
> -        for i in xrange(0, min(len(drivers), page_length)):
> -            driver_idx = ((page-1) * page_length) + i
> -            if drivers[driver_idx].selected:
> -                selected = "x"

My paging logic in here was, um, non-optimal :) See my patch for
1055333, whoever pushes second can rebase.

Looks good otherwise, I like the ability to reuse this to display
different lists.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list