summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-05-12 19:17:23 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-05-12 19:17:23 +0200
commitf22af48d8447393ad30561845f45d18a052d057c (patch)
treeab5ea55ec87607d5a765fc02dfd041a0a56cd853 /DistUpgrade
parentbd866f389dcf33182d0e4a41912c93bfe87848b3 (diff)
downloadpython-apt-f22af48d8447393ad30561845f45d18a052d057c.tar.gz
* DistUpgrade/DistUpgradeViewGtk.py:
- make the progress strings translatable in a useful way
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/Changelog2
-rw-r--r--DistUpgrade/DistUpgradeControler.py8
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py22
3 files changed, 24 insertions, 8 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog
index f50752a8..1e5d0ff1 100644
--- a/DistUpgrade/Changelog
+++ b/DistUpgrade/Changelog
@@ -1,5 +1,7 @@
2006-05-12:
- space checking improved (ubuntu: #43948)
+ - show software that was demoted from main -> universe
+ - improve the remaining time reporting
- translation updates
2006-05-09:
- upload
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 583fe4bd..1bfde361 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -91,7 +91,7 @@ class DistUpgradeControler(object):
for entry in self.sources:
# ignore invalid records (but update disabled ones)
# or cdrom entries
- if entry.invalid or entry.uri.startswith("cdrom:"):
+ if entry.invalid or entry.uri.startswith("cdrom:") or entry.disabled:
continue
logging.debug("examining: '%s'" % entry)
# check if it's a mirror (or offical site)
@@ -375,9 +375,9 @@ class DistUpgradeControler(object):
self._view.information(_("Some software no longer officially "
"supported"),
_("These installed packages are "
- "no longer officially supported,
- and are now only
- community-supported ('universe').\n\n"
+ "no longer officially supported, "
+ "and are now only "
+ "community-supported ('universe').\n\n"
"If you don't have 'universe' enabled "
"these packages will be suggested for "
"removal in the next step. "),
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index 8611c033..b642143f 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -46,6 +46,20 @@ from gettext import gettext as _
def utf8(str):
return unicode(str, 'latin1').encode('utf-8')
+def FuzzyTimeToStr(sec):
+ " return the time a bit fuzzy (no seconds if time > 60 secs "
+ if sec > 60*60*24:
+ return _("About %li days %li hours %li minutes remaining") % (sec/60/60/24,
+ (sec/60/60) % 24,
+ (sec/60) % 60)
+ if sec > 60*60:
+ return _("About %li hours %li minutes remaining") % (sec/60/60,
+ (sec/60) % 60)
+ if sec > 60:
+ return _("About %li minutes remaining") % (sec/60)
+ return _("About %li seconds remaining") % sec
+
+
class GtkOpProgress(apt.progress.OpProgress):
def __init__(self, progressbar):
self.progressbar = progressbar
@@ -106,7 +120,7 @@ class GtkFetchProgressAdapter(apt.progress.FetchProgress):
if self.currentCPS > 0:
self.status.set_text(_("Downloading file %li of %li at %s/s" % (currentItem, self.totalItems, apt_pkg.SizeToStr(self.currentCPS))))
- self.progress.set_text(_("%s remaining" % apt_pkg.TimeToStr(self.eta)))
+ self.progress.set_text(FuzzyTimeToStr(self.eta))
else:
self.status.set_text(_("Downloading file %li of %li" % (currentItem, self.totalItems)))
self.progress.set_text(" ")
@@ -218,8 +232,8 @@ class GtkInstallProgressAdapter(InstallProgress):
time_per_percent = (float(delta)/percent)
eta = (100.0 - self.percent) * time_per_percent
# only show if we have some sensible data
- if eta > 1.0 and eta < (60*60*24*2):
- self.progress.set_text(_("%s remaining")%apt_pkg.TimeToStr(eta))
+ if eta > 61.0 and eta < (60*60*24*2):
+ self.progress.set_text(FuzzyTimeToStr(eta))
else:
self.progress.set_text(" ")
@@ -533,7 +547,7 @@ if __name__ == "__main__":
#sys.exit(0)
ip.conffile("TODO","TODO~")
view.getTerminal().call(["dpkg","--configure","-a"])
- view.getTerminal().call(["ls","-R","/usr"])
+ #view.getTerminal().call(["ls","-R","/usr"])
view.error("short","long",
"asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended\n"
"asfds afsdj af asdf asdf asf dsa fadsf asdf as fasf sextended\n"