From 6dd632f5233fc6c6ffe04dd2d15b633f23c5e457 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Oct 2006 20:39:01 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - calculate the time spend in the ui as well (lp: #48733) * po/*: - make update-po --- DistUpgrade/DistUpgradeViewGtk.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index e77fe858..11b3e041 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -198,6 +198,7 @@ class GtkInstallProgressAdapter(InstallProgress): def conffile(self, current, new): logging.debug("got a conffile-prompt from dpkg for file: '%s'" % current) + start = time.time() #self.expander.set_expanded(True) prim = _("Replace the customized configuration file\n'%s'?") % current sec = _("You will lose any changes you have made to this " @@ -216,6 +217,7 @@ class GtkInstallProgressAdapter(InstallProgress): self.parent.textview_conffile.get_buffer().set_text(_("The 'diff' command was not found")) res = self.parent.dialog_conffile.run() self.parent.dialog_conffile.hide() + self.time_ui += time.time() - start # if replace, send this to the terminal if res == gtk.RESPONSE_YES: self.term.feed_child("y\n") @@ -242,9 +244,11 @@ class GtkInstallProgressAdapter(InstallProgress): self.last_activity = time.time() self.activity_timeout_reported = False delta = self.last_activity - self.start_time + # time wasted in conffile questions (or other ui activity) + delta -= self.time_ui time_per_percent = (float(delta)/percent) eta = (100.0 - self.percent) * time_per_percent - # only show if we have some sensible data + # only show if we have some sensible data (60sec < eta < 2days) if eta > 61.0 and eta < (60*60*24*2): self.progress.set_text(_("About %s remaining") % FuzzyTimeToStr(eta)) else: @@ -588,11 +592,11 @@ if __name__ == "__main__": fp = GtkFetchProgressAdapter(view) ip = GtkInstallProgressAdapter(view) - cache = apt.Cache() for pkg in sys.argv[1:]: cache[pkg].markInstall() cache.commit(fp,ip) + sys.exit(0) #sys.exit(0) ip.conffile("TODO","TODO~") -- cgit v1.2.3 From 3b322f37caa66b7fce40061e70273eb75248ffed Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Oct 2006 18:56:43 +0200 Subject: * debian/control: - add python-gconf dependency / remove python-gnome2 dependency * DistUpgrade/DistUpgradeViewGtk.py: - run while gtk_events_pending()/gtk_main_iteration() after information() --- DistUpgrade/DistUpgradeViewGtk.py | 2 ++ debian/changelog | 8 ++++++++ debian/control | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 11b3e041..3dcfb7ed 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -458,6 +458,8 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): self.dialog_information.window.set_functions(gtk.gdk.FUNC_MOVE) self.dialog_information.run() self.dialog_information.hide() + while gtk.events_pending(): + gtk.main_iteration() def error(self, summary, msg, extended_msg=None): self.dialog_error.set_transient_for(self.window_main) diff --git a/debian/changelog b/debian/changelog index 4f9c7dd0..fc133de0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +update-manager (0.45) edgy; urgency=low + + * debian/control: + - added dependency on python-gconf + - removed recommends on python-gnome2 + + -- Michael Vogt Wed, 11 Oct 2006 18:32:17 +0200 + update-manager (0.44.17) edgy; urgency=low * memory leak fixed (lp: #43096) diff --git a/debian/control b/debian/control index 7ed4c7a5..0702fa9e 100644 --- a/debian/control +++ b/debian/control @@ -7,8 +7,7 @@ Standards-Version: 3.6.2 Package: update-manager Architecture: all -Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu, iso-codes, python-dbus, python-vte, gksu -Recommends: python-gnome2 +Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu, iso-codes, python-dbus, python-vte, gksu, python-gconf Description: GNOME application that manages apt updates This is the GNOME apt update manager. It checks for updates and lets the user choose which to install. -- cgit v1.2.3 From 2ceb68d859ddc4f77db85d5f2348e615c33928d4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Oct 2006 20:45:01 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - use prev_step instead of last_step to make more clear what it is all about - check if the gtk-icon-cache needs to be reloaded on each step --- DistUpgrade/DistUpgradeViewGtk.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 3dcfb7ed..b2aff8dc 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -323,9 +323,10 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): gtk.window_set_default_icon(icons.load_icon("update-manager", 32, 0)) SimpleGladeApp.__init__(self, gladedir+"/DistUpgrade.glade", None, domain="update-manager") - self.last_step = 0 # keep a record of the latest step + self.prev_step = 0 # keep a record of the latest step # we dont use this currently #self.window_main.set_keep_above(True) + self.icontheme = gtk.icon_theme_get_default() self.window_main.realize() self.window_main.window.set_functions(gtk.gdk.FUNC_MOVE) self._opCacheProgress = GtkOpProgress(self.progressbar_cache) @@ -414,7 +415,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): label.hide() def abort(self): size = gtk.ICON_SIZE_MENU - step = self.last_step + step = self.prev_step if step > 0: image = getattr(self,"image_step%i" % step) arrow = getattr(self,"arrow_step%i" % step) @@ -422,18 +423,20 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): image.show() arrow.hide() def setStep(self, step): - # first update the "last" step as completed + if self.icontheme.rescan_if_needed(): + logging.debug("icon theme changed, re-reading") + # first update the "previous" step as completed size = gtk.ICON_SIZE_MENU attrlist=pango.AttrList() - if self.last_step: - image = getattr(self,"image_step%i" % self.last_step) - label = getattr(self,"label_step%i" % self.last_step) - arrow = getattr(self,"arrow_step%i" % self.last_step) + if self.prev_step: + image = getattr(self,"image_step%i" % self.prev_step) + label = getattr(self,"label_step%i" % self.prev_step) + arrow = getattr(self,"arrow_step%i" % self.prev_step) label.set_property("attributes",attrlist) image.set_from_stock(gtk.STOCK_APPLY, size) image.show() arrow.hide() - self.last_step = step + self.prev_step = step # show the an arrow for the current step and make the label bold image = getattr(self,"image_step%i" % step) label = getattr(self,"label_step%i" % step) -- cgit v1.2.3 From 830b5233ef8775cb39720fa1b1b48260fd27c9fd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Oct 2006 22:13:06 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - keep a png pixbuf loader refernce around --- DistUpgrade/Changelog | 7 +++++++ DistUpgrade/DistUpgradeViewGtk.py | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index 77682ef0..d86f520f 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,10 @@ +2006-10-11: + - keep pixbuf loader reference around so that we + have one after the upgrade when the old + /usr/lib/gtk-2.0/loader/2.4.0/ loader is gone. + This fixes the problem of missing stock-icons + after the upgrade. Also revalidate the theme + in each step. 2006-10-10: - fix time calculation - fix kubuntu upgrade case diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index b2aff8dc..b176e8f0 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -327,6 +327,11 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): # we dont use this currently #self.window_main.set_keep_above(True) self.icontheme = gtk.icon_theme_get_default() + # we keep a reference pngloader around so that its in memory + # -> this avoid the issue that during the dapper->edgy upgrade + # the loaders move from /usr/lib/gtk/2.4.0/loaders to 2.10.0 + self.pngloader = gtk.gdk.PixbufLoader("png") + self.window_main.realize() self.window_main.window.set_functions(gtk.gdk.FUNC_MOVE) self._opCacheProgress = GtkOpProgress(self.progressbar_cache) -- cgit v1.2.3 From 24e4c5f2f2474b659dc9543c908f00cf8d4900ac Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 17 Oct 2006 19:00:39 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - don't fail on unexpected input from dpkg --- DistUpgrade/Changelog | 3 +++ DistUpgrade/DistUpgradeViewGtk.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index a6faeb8a..050fc615 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,6 @@ +2006-10-17: + - ensure bzr and xserver-xorg-input-* is properly upgraded + - don't fail if dpkg sents unexpected status lines (lp: #66013) 2006-10-16: - remove leftover references to ubuntu-base and use ubuntu-minimal and ubuntu-standard instead diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index b176e8f0..13ede7ee 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -267,7 +267,10 @@ class GtkInstallProgressAdapter(InstallProgress): self.label_status.set_text("") def updateInterface(self): - InstallProgress.updateInterface(self) + try: + InstallProgress.updateInterface(self) + except ValueError, e: + logging.error("got ValueError from InstallPrgoress.updateInterface. Line was '%s' (%s)" % (self.read, e) # check if we haven't started yet with packages, pulse then if self.start_time == 0.0: self.progress.pulse() -- cgit v1.2.3 From ad1e40b643860122971a0ab8d942e54851458347 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 17 Oct 2006 19:06:06 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - embarassing typo --- DistUpgrade/DistUpgradeViewGtk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 13ede7ee..97a57772 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -270,7 +270,7 @@ class GtkInstallProgressAdapter(InstallProgress): try: InstallProgress.updateInterface(self) except ValueError, e: - logging.error("got ValueError from InstallPrgoress.updateInterface. Line was '%s' (%s)" % (self.read, e) + logging.error("got ValueError from InstallPrgoress.updateInterface. Line was '%s' (%s)" % (self.read, e)) # check if we haven't started yet with packages, pulse then if self.start_time == 0.0: self.progress.pulse() -- cgit v1.2.3 From 1ef0b5e24d3b508b8b43f2643ff1c4932e091774 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 28 Oct 2006 12:31:29 +0200 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - protect against errors when setting the icon (lp: #68697) --- DistUpgrade/Changelog | 2 ++ DistUpgrade/DistUpgradeViewGtk.py | 6 +++++- debian/changelog | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index b42e2d76..f890bf04 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,5 @@ +2006-10-28: + - catch errors when load_icon() does not work 2006-10-26: - make sure that xserver-xorg-video-all get installed if xserver-xorg-driver-all was installed before (lp: #58424) diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 97a57772..a34e90f6 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -323,7 +323,11 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): logging.warning("Error setting locales (%s)" % e) icons = gtk.icon_theme_get_default() - gtk.window_set_default_icon(icons.load_icon("update-manager", 32, 0)) + try: + gtk.window_set_default_icon(icons.load_icon("update-manager", 32, 0)) + except gobject.GError, e: + logging.debug("error setting default icon, ignoring (%s)" % e) + pass SimpleGladeApp.__init__(self, gladedir+"/DistUpgrade.glade", None, domain="update-manager") self.prev_step = 0 # keep a record of the latest step diff --git a/debian/changelog b/debian/changelog index fc133de0..3d13d542 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +update-manager (0.45.1) edgy-updates; urgency=low + + * handle unexpected data from data more gracefuly (lp: #68553) + + -- Michael Vogt Fri, 27 Oct 2006 10:23:39 +0200 + update-manager (0.45) edgy; urgency=low * debian/control: -- cgit v1.2.3 From 0b971142001adf68f9014ec2526ad2f4ac18e820 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 30 Oct 2006 16:59:56 +0100 Subject: * DistUpgrade/DistUpgradeViewGtk.py: - reset self.read when unexpected data arrives --- DistUpgrade/Changelog | 3 +++ DistUpgrade/DistUpgradeViewGtk.py | 2 ++ 2 files changed, 5 insertions(+) (limited to 'DistUpgrade/DistUpgradeViewGtk.py') diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index f890bf04..46e6fb89 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,5 +1,8 @@ 2006-10-28: - catch errors when load_icon() does not work +2006-10-27: + - reset self.read so that we do not loop endlessly when dpkg + sends unexpected data (lp: #68553) 2006-10-26: - make sure that xserver-xorg-video-all get installed if xserver-xorg-driver-all was installed before (lp: #58424) diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index a34e90f6..07a94110 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -271,6 +271,8 @@ class GtkInstallProgressAdapter(InstallProgress): InstallProgress.updateInterface(self) except ValueError, e: logging.error("got ValueError from InstallPrgoress.updateInterface. Line was '%s' (%s)" % (self.read, e)) + # reset self.read so that it can continue reading and does not loop + self.read = "" # check if we haven't started yet with packages, pulse then if self.start_time == 0.0: self.progress.pulse() -- cgit v1.2.3