WebBrowser/Download/DownloadUtilities.py

changeset 6226
bb6b83b72a5d
parent 6221
35ec993034e1
child 6645
ad476851d7e0
equal deleted inserted replaced
6225:56b6f18abc21 6226:bb6b83b72a5d
23 """ 23 """
24 if timeRemaining < 10: 24 if timeRemaining < 10:
25 return QCoreApplication.translate( 25 return QCoreApplication.translate(
26 "DownloadUtilities", "few seconds remaining") 26 "DownloadUtilities", "few seconds remaining")
27 elif timeRemaining < 60: # < 1 minute 27 elif timeRemaining < 60: # < 1 minute
28 seconds = int(timeRemaining)
28 return QCoreApplication.translate( 29 return QCoreApplication.translate(
29 "DownloadUtilities", 30 "DownloadUtilities", "%n seconds remaining", "", seconds)
30 "%n seconds remaining", "", int(timeRemaining))
31 elif timeRemaining < 3600: # < 1 hour 31 elif timeRemaining < 3600: # < 1 hour
32 minutes = int(timeRemaining / 60)
32 return QCoreApplication.translate( 33 return QCoreApplication.translate(
33 "DownloadUtilities", 34 "DownloadUtilities", "%n minutes remaining", "", minutes)
34 "%n minutes remaining", "", int(timeRemaining / 60))
35 else: 35 else:
36 QCoreApplication.translate( 36 hours = int(timeRemaining / 3600)
37 "DownloadUtilities", 37 return QCoreApplication.translate(
38 "%n hours remaining", "", int(timeRemaining / 3600)) 38 "DownloadUtilities", "%n hours remaining", "", hours)
39 39
40 40
41 def dataString(size): 41 def dataString(size):
42 """ 42 """
43 Module function to generate a formatted size string. 43 Module function to generate a formatted size string.

eric ide

mercurial