summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui/tui
diff options
context:
space:
mode:
authorVratislav Podzimek <vpodzime@redhat.com>2013-01-17 13:00:07 +0100
committerVratislav Podzimek <vpodzime@redhat.com>2013-01-22 13:01:45 +0100
commit25007061a631905368d39731e56691260d4cad0d (patch)
treefcfd7ab8dab7c956396ae2241d661f19b3fe444e /pyanaconda/ui/tui
parenta5b3cb77c2c5520ac9e53606913efc4083aa159f (diff)
downloadanaconda-25007061a631905368d39731e56691260d4cad0d.tar.gz
anaconda-25007061a631905368d39731e56691260d4cad0d.tar.xz
anaconda-25007061a631905368d39731e56691260d4cad0d.zip
Refactor and cleanup exception handling pieces
Before this patch our UserInterface classes somehow "implicitly" inherited python-meh's *Intf classes by providing two methods with right names. This patch adds a meh_interface property to our UserInterface classes that returns an instance of a class that really is inherited from the python-meh's *Intf class or actually is an instance of the python-meh's *Intf class in case of gui and tui respectively. It also adds a tty_num property to our *UserInterface classes that can be used in runDebug to get user to the right console before and after the pdb session automatically.
Diffstat (limited to 'pyanaconda/ui/tui')
-rw-r--r--pyanaconda/ui/tui/__init__.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 4b31d5ba1..83c2bebe8 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -132,6 +132,7 @@ class TextUserInterface(ui.UserInterface):
ui.UserInterface.__init__(self, storage, payload, instclass)
self._app = None
+ self._meh_interface = meh.ui.text.TextIntf()
basemask = "pyanaconda.ui.tui"
basepath = os.path.dirname(__file__)
@@ -149,6 +150,14 @@ class TextUserInterface(ui.UserInterface):
for path in pathlist]
}
+ @property
+ def tty_num(self):
+ return 1
+
+ @property
+ def meh_interface(self):
+ return self._meh_interface
+
def _list_hubs(self):
"""returns the list of hubs to use"""
return [SummaryHub, ProgressHub]
@@ -229,11 +238,3 @@ class TextUserInterface(ui.UserInterface):
question_window = YesNoDialog(self._app, message)
self._app.switch_screen_modal(question_window)
return question_window.answer
-
- def mainExceptionWindow(self, text, exn_file, *args, **kwargs):
- meh_intf = meh.ui.text.TextIntf()
- return meh_intf.mainExceptionWindow(text, exn_file, *args, **kwargs)
-
- def saveExceptionWindow(self, signature, *args, **kwargs):
- meh_intf = meh.ui.text.TextIntf()
- return meh_intf.saveExceptionWindow(signature, *args, **kwargs)