[master/f18-branch] [PATCH] Fix getting country layout variants

Vratislav Podzimek vpodzime at redhat.com
Tue Dec 11 11:27:28 UTC 2012


On Thu, 2012-12-06 at 13:55 +0100, Vratislav Podzimek wrote:
> Commit 70e339b86b0d4a000e0e62253703ac4ca8618b74 introduced the bug
> resulting in almost empty dictionary of country layout variants.
> Iteration over countries uses the same _get_variant method as iteration
> over languages, but comes afterwards. The check added in
> 70e339b86b0d4a000e0e62253703ac4ca8618b74 fails for almost every layout
> that is processed in iteration over countries.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  pyanaconda/keyboard.py | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
> index 828c709..7c00340 100755
> --- a/pyanaconda/keyboard.py
> +++ b/pyanaconda/keyboard.py
> @@ -356,7 +356,7 @@ class XklWrapper(object):
>          #'grp' means that we want layout (group) switching options
>          self.configreg.foreach_option('grp', self._get_switch_option, None)
>  
> -    def _get_variant(self, c_reg, item, subitem, dest):
> +    def _get_variant(self, c_reg, item, subitem, lang):
>          if subitem:
>              name = item_str(item.name) + " (" + item_str(subitem.name) + ")"
>              description = item_str(subitem.description)
> @@ -366,11 +366,13 @@ class XklWrapper(object):
>  
>          #if this layout has already been added for some other language,
>          #do not add it again (would result in duplicates in our lists)
> -        if name not in self.name_to_show_str:
> -            if dest:
> -                self.name_to_show_str[name] = "%s (%s)" % (dest.encode("utf-8"),
> +        if lang and name not in self.name_to_show_str:
> +            self.name_to_show_str[name] = "%s (%s)" % (lang.encode("utf-8"),
>                                                      description.encode("utf-8"))
> -
> +            self._variants_list.append(_Layout(name, description))
> +        else:
This should be 'elif lang is None:'. Fixed locally, pushing.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list