From 37a3751442541410f61f08d60f61a16794edf5f5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 22 Jan 2006 20:24:04 +0100 Subject: * Deal with install errors --- DistUpgrade/DistUpgradeControler.py | 2 +- DistUpgrade/DistUpgradeViewGtk.py | 27 +++++++++++++++++++++++++-- UpdateManager/UpdateManager.py | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index efb93bcc..d7c1c84c 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -176,7 +176,7 @@ class DistUpgradeControler(object): iprogress = self._view.getInstallProgress() try: res = self.cache.commit(fprogress,iprogress) - except IOError, e: + except (SystemError, IOError), e: self._view.error(_("Error during commit"), _("Some problem occured during the upgrade. " "This is mostly a network problem, please " diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index c39efbe6..4b4b0761 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -106,6 +106,7 @@ class GtkInstallProgressAdapter(InstallProgress): self.progress = parent.progressbar_cache self.expander = parent.expander_terminal self.term = parent._term + self.parent = parent # setup the child waiting reaper = vte.reaper_get() reaper.connect("child-exited", self.child_exited) @@ -124,8 +125,30 @@ class GtkInstallProgressAdapter(InstallProgress): self.env = ["VTE_PTY_KEEP_FD=%s"% self.writefd, "DEBIAN_FRONTEND=gnome", "APT_LISTCHANGES_FRONTEND=gtk"] - def error(self, error): - pass + def error(self, pkg, errormsg): + dialog = gtk.MessageDialog(self.parent.window_main, 0, + gtk.MESSAGE_ERROR, + gtk.BUTTONS_OK,"") + summary = _("Error installing '%s'" % pkg) + msg = _("During the install a error occured. This is usually a bug " + "in the packages, please report it. See the message below " + "for more information. ") + msg="%s\n\n%s" % (summary,msg) + dialog.set_markup(msg) + dialog.vbox.set_spacing(6) + if errormsg != None: + scroll = gtk.ScrolledWindow() + scroll.set_size_request(400,200) + textview = gtk.TextView() + textview.set_cursor_visible(False) + textview.set_editable(False) + textview.get_buffer().set_text(errormsg) + textview.show() + scroll.add(textview) + scroll.show() + dialog.vbox.pack_end(scroll) + dialog.run() + dialog.destroy() def conffile(self, current, new): pass def fork(self): diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 7f832c06..89107f95 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -390,7 +390,7 @@ class UpdateManager(SimpleGladeApp): text_header= _("No updates available") text_download = "" else: - text_header = gettext.ngettext("You can install one update", "You can install %s updates" % len(self.packages), len(self.packages)) + text_header = gettext.ngettext("You can install one update", "You can install %s updates" % len(self.store), len(self.store)) text_download = _("Download size: %s" % apt_pkg.SizeToStr(self.dl_size)) self.label_header.set_markup(text_header) -- cgit v1.2.3 From a7470cfe01b96da3d387e098630d15e913f7f145 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 22 Jan 2006 21:29:22 +0100 Subject: * expand the terminal on a conffile question --- DistUpgrade/DistUpgradeControler.py | 9 +++++++++ DistUpgrade/DistUpgradeViewGtk.py | 1 + 2 files changed, 10 insertions(+) diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index d7c1c84c..e67009cf 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -211,6 +211,15 @@ class DistUpgradeControler(object): changes, 0): fprogress = self._view.getFetchProgress() iprogress = self._view.getInstallProgress() + try: + res = self.cache.commit(fprogress,iprogress) + except (SystemError, IOError), e: + self._view.error(_("Error during commit"), + _("Some problem occured during the clean-up. " + "Please see the below message for more " + "information. ", + "%s" % e) + self.cache.commit(fprogress,iprogress) def askForReboot(self): diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 4b4b0761..55f1f6fd 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -150,6 +150,7 @@ class GtkInstallProgressAdapter(InstallProgress): dialog.run() dialog.destroy() def conffile(self, current, new): + self.expander.set_expanded=True pass def fork(self): pid = self.term.forkpty(envv=self.env) -- cgit v1.2.3