From: "Brian C. Lane" bcl@redhat.com
The base class should have a generic message, not one that is specific to the username entry.
Related: rhbz#1248421 --- pyanaconda/ui/tui/spokes/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py index 456b5c8..b6d6288 100644 --- a/pyanaconda/ui/tui/spokes/__init__.py +++ b/pyanaconda/ui/tui/spokes/__init__.py @@ -97,7 +97,11 @@ class NormalTUISpoke(TUISpoke, NormalSpoke): # Inherit abstract methods from NormalTUISpoke # pylint: disable=abstract-method class EditTUIDialog(NormalTUISpoke): - """Spoke/dialog used to read new value of textual or password data""" + """Spoke/dialog used to read new value of textual or password data + + To override the wrong input message set the wrong_input_message attribute + to a translated string. + """
title = N_("New value") PASSWORD = re.compile(".*") @@ -174,8 +178,7 @@ def input(self, entry, key): if self.wrong_input_message: print(self.wrong_input_message) else: - print(_("You have provided an invalid user name: %s\n" - "Tip: Keep your user name shorter than 32 characters and do not use spaces.\n") % key) + print(_("You have provided an invalid value\n")) return NormalTUISpoke.input(self, entry, key)
class OneShotEditTUIDialog(EditTUIDialog):
Added label: rhel7-branch.
Added label: master.
From: "Brian C. Lane" bcl@redhat.com
Resolves: rhbz#1248421 --- pyanaconda/ui/tui/spokes/user.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py index 029b939..68a6fbe 100644 --- a/pyanaconda/ui/tui/spokes/user.py +++ b/pyanaconda/ui/tui/spokes/user.py @@ -67,6 +67,9 @@ def should_run(cls, environment, data): def __init__(self, app, data, storage, payload, instclass): FirstbootSpokeMixIn.__init__(self) EditTUISpoke.__init__(self, app, data, storage, payload, instclass) + self.dialog.wrong_input_message = _("You have provided an invalid user name.\n" + "Tip: Keep your user name shorter than 32 " + "characters and do not use spaces.\n")
if self.data.user.userList: self.args = self.data.user.userList[0]
Looks good to me.
Added label: ACK.
Looks good to me too.
Closed.
Pushed.
anaconda-patches@lists.fedorahosted.org