diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-29 23:11:17 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-29 23:11:17 +0200 |
| commit | ab901030dbec4180254a680dd1c49016cfc36d4a (patch) | |
| tree | e4534baa3153a2b66ce9d69d7b1ba00ceb0908cc /DistUpgrade/DistUpgradeView.py | |
| parent | 9a8c25937bfac8242b7eef9f3f815a273392606a (diff) | |
| download | python-apt-ab901030dbec4180254a680dd1c49016cfc36d4a.tar.gz | |
* DistUpgrade/*:
- added download time estimation (based on modem and 1Mbit DSL)
Diffstat (limited to 'DistUpgrade/DistUpgradeView.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeView.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index 4b24ee7f..6d6d5516 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -19,6 +19,17 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +def FuzzyTimeToStr(sec): + " return the time a bit fuzzy (no seconds if time > 60 secs " + if sec > 60*60*24: + return _("%li days %li hours %li minutes") % (sec/60/60/24, (sec/60/60) % 24, (sec/60) % 60) + if sec > 60*60: + return _("%li hours %li minutes") % (sec/60/60, (sec/60) % 60) + if sec > 60: + return _("%li minutes") % (sec/60) + return _("%li seconds") % sec + + class DumbTerminal(object): def call(self, cmd): " expects a command in the subprocess style (as a list) " |
