summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 23:13:39 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 23:13:39 +0200
commitc9d03a8a633afd3b6a17b985bc640d59c6889a45 (patch)
treea480caae7d8f047b4ff939b595c7c82a9a356b26 /DistUpgrade
parentab901030dbec4180254a680dd1c49016cfc36d4a (diff)
downloadpython-apt-c9d03a8a633afd3b6a17b985bc640d59c6889a45.tar.gz
* DistUpgrade/
- actually show the estiamted download time
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeCache.py9
-rw-r--r--DistUpgrade/DistUpgradeView.py9
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py3
3 files changed, 11 insertions, 10 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index e1f892ac..37dd96db 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -36,15 +36,6 @@ class MyCache(apt.Cache):
pm.GetArchives(fetcher, self._list, self._records)
return fetcher.FetchNeeded
@property
- def estimatedDownloadTime(self):
- """ get the estimated download time """
- requiredDownload = self.requiredDownload
- timeModem = requiredDownload/(56*1024/8) # 56 kbit
- timeDSL = requiredDownload/(1024*1024/8) # 1Mbit = 1024 kbit
- s= _("The download will approximately take %s with a 56k modem and %s with "
- "a 1Mbit DSL connection" % FuzzyTimeToStr(timeModem), FuzzyTimeToStr(timeDSL))
- return s
- @property
def additionalRequiredSpace(self):
""" get the size of the additonal required space on the fs """
return self._depcache.UsrSize
diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py
index 6d6d5516..a42d2b8f 100644
--- a/DistUpgrade/DistUpgradeView.py
+++ b/DistUpgrade/DistUpgradeView.py
@@ -29,6 +29,15 @@ def FuzzyTimeToStr(sec):
return _("%li minutes") % (sec/60)
return _("%li seconds") % sec
+def estimatedDownloadTime(self, size):
+ """ get the estimated download time """
+ requiredDownload = self.requiredDownload
+ timeModem = requiredDownload/(56*1024/8) # 56 kbit
+ timeDSL = requiredDownload/(1024*1024/8) # 1Mbit = 1024 kbit
+ s= _("The download will approximately take %s with a 56k modem and %s with "
+ "a 1Mbit DSL connection" % FuzzyTimeToStr(timeModem), FuzzyTimeToStr(timeDSL))
+ return s
+
class DumbTerminal(object):
def call(self, cmd):
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index bb2e63e2..90d1e157 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -37,7 +37,7 @@ import apt_pkg
import os
from apt.progress import InstallProgress
-from DistUpgradeView import DistUpgradeView, FuzzyTimeToStr
+from DistUpgradeView import DistUpgradeView, FuzzyTimeToStr, estimatedDownloadTime
from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp, bindtextdomain
import gettext
@@ -476,6 +476,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
if downloadSize > 0:
msg += _("You have to download a total of %s." %\
apt_pkg.SizeToStr(downloadSize))
+ msg += estimatedDownloadTime(downloadSize)
if (pkgs_upgrade + pkgs_inst + pkgs_remove) > 100:
msg += "\n\n%s" % _("The upgrade can take several hours and "\