Helpviewer/Download/DownloadUtilities.py

changeset 2954
bf0215fe12d1
parent 2302
f29e9405c851
child 3022
57179e4cdadd
child 3057
10516539f238
equal deleted inserted replaced
2953:703452a2876f 2954:bf0215fe12d1
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 # Copyright (c) 2010 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2010 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5
6 """
7 Module implementing some utility functions for the Download package.
8 """
5 9
6 from PyQt4.QtCore import QCoreApplication 10 from PyQt4.QtCore import QCoreApplication
7 11
8 12
9 def timeString(timeRemaining): 13 def timeString(timeRemaining):
14 @return time string (string) 18 @return time string (string)
15 """ 19 """
16 if timeRemaining > 60: 20 if timeRemaining > 60:
17 minutes = int(timeRemaining / 60) 21 minutes = int(timeRemaining / 60)
18 seconds = int(timeRemaining % 60) 22 seconds = int(timeRemaining % 60)
19 remaining = QCoreApplication.translate("DownloadUtilities", 23 remaining = QCoreApplication.translate(
20 "%n:{0:02} minutes remaining""", "", QCoreApplication.UnicodeUTF8, minutes)\ 24 "DownloadUtilities",
21 .format(seconds) 25 "%n:{0:02} minutes remaining""", "",
26 QCoreApplication.UnicodeUTF8, minutes).format(seconds)
22 else: 27 else:
23 seconds = int(timeRemaining) 28 seconds = int(timeRemaining)
24 remaining = QCoreApplication.translate("DownloadUtilities", 29 remaining = QCoreApplication.translate("DownloadUtilities",
25 "%n seconds remaining", "", QCoreApplication.UnicodeUTF8, seconds) 30 "%n seconds remaining", "", QCoreApplication.UnicodeUTF8, seconds)
26 31

eric ide

mercurial