summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeCache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 23:11:17 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 23:11:17 +0200
commitab901030dbec4180254a680dd1c49016cfc36d4a (patch)
treee4534baa3153a2b66ce9d69d7b1ba00ceb0908cc /DistUpgrade/DistUpgradeCache.py
parent9a8c25937bfac8242b7eef9f3f815a273392606a (diff)
downloadpython-apt-ab901030dbec4180254a680dd1c49016cfc36d4a.tar.gz
* DistUpgrade/*:
- added download time estimation (based on modem and 1Mbit DSL)
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
-rw-r--r--DistUpgrade/DistUpgradeCache.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index 455ef34f..e1f892ac 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -8,6 +8,7 @@ import re
import logging
from gettext import gettext as _
from DistUpgradeConfigParser import DistUpgradeConfig
+from DistUpgradeView import FuzzyTimeToStr
class MyCache(apt.Cache):
# init
@@ -35,6 +36,15 @@ 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