[anaconda][rhel7-branch/master][PATCH] Show an alternative prompt if a hub contains only a single spoke (#1199234)

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 3 12:32:45 UTC 2015


On Fri, 2015-07-03 at 13:38 +0200, Martin Kolman wrote:
> Otherwise it is not readily apparent that the user needs to press
> 1 to enter the single visible spoke.
> 
> This is currently most relevant for Initial Setup which shows only
> the EULA spoke if user has already been created during the installation.
> 
> Resolves: rhbz#1199234
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  pyanaconda/ui/tui/hubs/__init__.py | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py
> index e89bf71..525b68e 100644
> --- a/pyanaconda/ui/tui/hubs/__init__.py
> +++ b/pyanaconda/ui/tui/hubs/__init__.py
> @@ -114,3 +114,22 @@ class TUIHub(TUIObject, common.Hub):
>                          print(_("Please complete all spokes before continuing"))
>                          return False
>              return key
> +
> +    def prompt(self, args=None):
> +        """Show an alternative prompt if the hub contains only one spoke.
> +        Otherwise it is not readily apparent that the user needs to press
> +        1 to enter the single visible spoke.
> +
> +        :param args: optional argument passed from switch_screen calls
> +        :type args: anything
> +
> +        :return: returns text to be shown next to the prompt for input or None
> +                 to skip further input processing
> +        :rtype: str|None
> +        """
> +        if self._spoke_count == 1:
> +            single_spoke_title = self._spokes.values()[0].title
> +            return _(u"  Please make your choice from [ '1' to enter the %s spoke | 'q' to quit |\n"
> +                     "  'c' to continue | 'r' to refresh]: " % single_spoke_title)
The translation needs to happen before the pattern replacement.

Looks good to me otherwise.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list