From ab901030dbec4180254a680dd1c49016cfc36d4a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 29 Aug 2006 23:11:17 +0200 Subject: * DistUpgrade/*: - added download time estimation (based on modem and 1Mbit DSL) --- DistUpgrade/DistUpgradeView.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'DistUpgrade/DistUpgradeView.py') 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) " -- cgit v1.2.3