client/rhel/rhn-client-tools/src/up2date_client/tui.py | 30 +++++++++++++----
1 file changed, 23 insertions(+), 7 deletions(-)
New commits:
commit 02c01d34a228c99f81aa57786b565d4a3d133793
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Mar 29 12:05:18 2010 +0200
If the window is to be skipped, it should raise WindowSkipException in constructor.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index c015894..9dae532 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -92,6 +92,11 @@ def tui_call_wrapper(screen, func, *params):
return results
+class WindowSkipException:
+
+ def __init__(self):
+ pass
+
class ConnectWindow:
def __init__(self, screen, tui):
@@ -383,6 +388,11 @@ class InfoWindow:
class OSReleaseWindow:
def __init__(self, screen, tui):
+
+ if not rhnreg.server_supports_eus():
+ log.log_debug("Server does not support EUS, skipping
OSReleaseWindow")
+ raise WindowSkipException()
+
self.name = "OSReleaseWindow"
self.screen = screen
self.tui = tui
@@ -1256,19 +1266,22 @@ class Tui:
log.log_debug("Running %s" % self.__class__.__name__)
self.initResults()
+ direction = "forward"
+
try:
index = 0
while index < len(self.windows):
- # check if we support eus before calling the instance
- if self.windows[index].__name__ == 'OSReleaseWindow':
- if not rhnreg.server_supports_eus():
- log.log_debug("skipping osrelease window")
+ win = None
+ try:
+ win = self.windows[index](self.screen, self)
+ except WindowSkipException:
+ if direction == "forward":
index = index + 1
- continue
+ else:
+ index = index - 1
+ continue
- win = self.windows[index](self.screen, self)
-
# Don't offer group selection screen if the user is not
# a member of multiple groups.
log.log_debug("index is %s" % index)
@@ -1306,6 +1319,8 @@ class Tui:
index = index - 3
else:
index = index - 1
+
+ direction = "backward"
elif result == "cancel":
log.log_debug("Caught a cancel request")
@@ -1316,6 +1331,7 @@ class Tui:
elif result == "next":
index = index + 1
win.saveResults()
+ direction = "forward"
finally:
self.screen.finish()
Show replies by date