WebBrowser/Download/DownloadUtilities.py

branch
QtWebEngine
changeset 4838
daa974f7dbac
parent 4828
b313794f46a2
parent 4768
57da9217196b
child 5389
9b1c800daff3
equal deleted inserted replaced
4832:6032ba9fdcc7 4838:daa974f7dbac
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import QCoreApplication 12 from PyQt5.QtCore import QCoreApplication
13 13
14 from Globals import translate
15
14 16
15 def timeString(timeRemaining): 17 def timeString(timeRemaining):
16 """ 18 """
17 Module function to format the given time. 19 Module function to format the given time.
18 20
20 @return time string (string) 22 @return time string (string)
21 """ 23 """
22 if timeRemaining > 60: 24 if timeRemaining > 60:
23 minutes = int(timeRemaining / 60) 25 minutes = int(timeRemaining / 60)
24 seconds = int(timeRemaining % 60) 26 seconds = int(timeRemaining % 60)
25 remaining = QCoreApplication.translate( 27 remaining = translate(
26 "DownloadUtilities", 28 "DownloadUtilities",
27 "%n:{0:02} minutes remaining""", "", 29 "%n:{0:02} minutes remaining", "",
28 minutes).format(seconds) 30 minutes).format(seconds)
29 else: 31 else:
30 seconds = int(timeRemaining) 32 seconds = int(timeRemaining)
31 remaining = QCoreApplication.translate( 33 remaining = translate(
32 "DownloadUtilities", 34 "DownloadUtilities",
33 "%n seconds remaining", "", seconds) 35 "%n seconds remaining", "", seconds)
34 36
35 return remaining 37 return remaining
36 38

eric ide

mercurial