From: Chris Lumens <clumens@xxxxxxxxxx> Since pyparted has a lot more execption classes now, it makes sense to just let anaconda's regular exception handling framework deal with them. This means a lot of changes throughout are on the way. --- cmdline.py | 15 --------------- gui.py | 35 ----------------------------------- text.py | 30 ------------------------------ 3 files changed, 0 insertions(+), 80 deletions(-) diff --git a/cmdline.py b/cmdline.py index 4e90fc3..7b925c9 100644 --- a/cmdline.py +++ b/cmdline.py @@ -107,20 +107,6 @@ class InstallInterface: def exceptionWindow(self, shortText, longTextFile): print(shortText) - def partedExceptionWindow(self, exc): - # if our only option is to cancel, let us handle the exception - # in our code and avoid popping up the exception window here. - log.critical("parted exception: %s: %s" %(exc.type_string,exc.message)) - if exc.options == parted.EXCEPTION_CANCEL: - return parted.EXCEPTION_UNHANDLED - - print(_("Parted exceptions can't be handled in command line mode!")) - print(exc.message) - - # don't exit - while 1: - time.sleep(5) - def waitWindow(self, title, text): return WaitWindow(title, text) @@ -131,7 +117,6 @@ class InstallInterface: anaconda.id.fsset.registerMessageWindow(self.messageWindow) anaconda.id.fsset.registerProgressWindow(self.progressWindow) anaconda.id.fsset.registerWaitWindow(self.waitWindow) - parted.exception_set_handler(self.partedExceptionWindow) (step, instance) = anaconda.dispatch.currentStep() while step: diff --git a/gui.py b/gui.py index b2e6916..ab34474 100644 --- a/gui.py +++ b/gui.py @@ -213,39 +213,6 @@ def processEvents(): while gtk.events_pending(): gtk.main_iteration(False) -def partedExceptionWindow(exc): - # if our only option is to cancel, let us handle the exception - # in our code and avoid popping up the exception window here. - if exc.options == parted.EXCEPTION_CANCEL: - return parted.EXCEPTION_UNHANDLED - log.critical("parted exception: %s: %s" %(exc.type_string,exc.message)) - print(exc.type_string) - print(exc.message) - print(exc.options) - win = gtk.Dialog(exc.type_string, mainWindow, gtk.DIALOG_MODAL) - addFrame(win) - win.set_position(gtk.WIN_POS_CENTER) - label = WrappingLabel(exc.message) - win.vbox.pack_start (label) - numButtons = 0 - buttonToAction = {} - - exflags = ((parted.EXCEPTION_FIX, N_("Fix")), - (parted.EXCEPTION_YES, N_("Yes")), - (parted.EXCEPTION_NO, N_("No")), - (parted.EXCEPTION_OK, N_("OK")), - (parted.EXCEPTION_RETRY, N_("Retry")), - (parted.EXCEPTION_IGNORE, N_("Ignore")), - (parted.EXCEPTION_CANCEL, N_("Cancel"))) - for flag, string in exflags: - if exc.options & flag: - win.add_button(_(string), flag) - win.show_all() - rc = win.run() - win.destroy() - - return rc - def widgetExpander(widget, growTo=None): widget.connect("size-allocate", growToParent, growTo) @@ -1305,8 +1272,6 @@ class InstallInterface: anaconda.id.fsset.registerProgressWindow(self.progressWindow) anaconda.id.fsset.registerWaitWindow(self.waitWindow) - parted.exception_set_handler(partedExceptionWindow) - self.icw = InstallControlWindow (self.anaconda) self.icw.run (self.runres) diff --git a/text.py b/text.py index d3dd568..93241a2 100644 --- a/text.py +++ b/text.py @@ -567,34 +567,6 @@ class InstallInterface: win = SaveExceptionWindow (anaconda, longTextFile, self.screen) return win - def partedExceptionWindow(self, exc): - # if our only option is to cancel, let us handle the exception - # in our code and avoid popping up the exception window here. - if exc.options == parted.EXCEPTION_CANCEL: - return parted.EXCEPTION_UNHANDLED - log.critical("parted exception: %s: %s" %(exc.type_string,exc.message)) - buttons = [] - buttonToAction = {} - flags = ((parted.EXCEPTION_FIX, N_("Fix")), - (parted.EXCEPTION_YES, N_("Yes")), - (parted.EXCEPTION_NO, N_("No")), - (parted.EXCEPTION_OK, N_("OK")), - (parted.EXCEPTION_RETRY, N_("Retry")), - (parted.EXCEPTION_IGNORE, N_("Ignore")), - (parted.EXCEPTION_CANCEL, N_("Cancel"))) - for flag, errorstring in flags: - if exc.options & flag: - buttons.append(_(errorstring)) - buttonToAction[string.lower(_(errorstring))] = flag - - rc = None - while not buttonToAction.has_key(rc): - rc = ButtonChoiceWindow(self.screen, exc.type_string, exc.message, - buttons=buttons) - - return buttonToAction[rc] - - def waitWindow(self, title, text): return WaitWindow(self.screen, title, text) @@ -671,8 +643,6 @@ class InstallInterface: anaconda.id.fsset.registerProgressWindow(self.progressWindow) anaconda.id.fsset.registerWaitWindow(self.waitWindow) - parted.exception_set_handler(self.partedExceptionWindow) - lastrc = INSTALL_OK (step, instance) = anaconda.dispatch.currentStep() while step: -- 1.6.1.3 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list