[PATCH 5/9] Add declarative EditTUISpoke

Vratislav Podzimek vpodzime at redhat.com
Wed Mar 13 11:24:49 UTC 2013


On Tue, 2013-03-12 at 15:09 +0100, Martin Sivak wrote:
> +    def prompt(self, (title, value, regex, cond)):
> +        if regex == self.PASSWORD:
> +            pw = self._app.raw_input(_("%s: ") % title, hidden=True)
> +            confirm = self._app.raw_input(_("%s (confirm): ") % title, hidden=True)
> +            error = None
> +            # just returning an error is either blank or mismatched
> +            # passwords.  Raising is because of poor quality.
> +            try:
> +                error = validatePassword(pw, confirm)
> +                if error:
> +                    print(error)
> +                    return None
> +            except PWQError as (e, msg):
> +                error = _("You have provided a weak password: %s. " % msg)
> +                error += _("\nWould you like to use it anyway?")
> +                question_window = YesNoDialog(self._app, error)
> +                self._app.switch_screen_modal(question_window)
> +                if not question_window.answer:
> +                    return None
This method should use the new EditTUISpokeEntry namedtuple.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list