[PATCH 2/2] Fix reprompting and screen redrawing on invalid input

Vratislav Podzimek vpodzime at redhat.com
Thu Feb 14 12:30:36 UTC 2013


This fixes the behaviour if an invalid input was provided. 5 times it just
reprompts for the input then it redraws the screen a resets the counter.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/tui/simpleline/base.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index e3039d2..94d37c5 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -193,11 +193,15 @@ class App(object):
             # and skip the input processing once, to redisplay the screen first
             self.redraw()
             input_needed = False
-        else:
+        elif self._redraw:
             # get the widget tree from the screen and show it in the screen
             input_needed = screen.refresh(args)
             screen.window.show_all()
             self._redraw = False
+        else:
+            # this can happen only in case there was invalid input and prompt
+            # should be shown again
+            input_needed = True
 
         return input_needed
 
@@ -231,7 +235,7 @@ class App(object):
             try:
                 # draw the screen if redraw is needed or the screen changed
                 # (unlikely to happen separately, but just be sure)
-                if self._redraw or last_screen != self._screens[-1]:
+                if self._redraw or last_screen != self._screens[-1][0]:
                     # we have fresh screen, reset error counter
                     error_counter = 0
                     if not self._do_redraw():
-- 
1.7.11.7



More information about the anaconda-patches mailing list