slight refactoring
This commit is contained in:
parent
2d771a60c2
commit
93eb0db434
@ -445,13 +445,13 @@ class UiManager(object):
|
|||||||
def promptFor(self, prompt):
|
def promptFor(self, prompt):
|
||||||
return self.__ui.promptFor(prompt)
|
return self.__ui.promptFor(prompt)
|
||||||
|
|
||||||
def formatTime(self, value):
|
def formatTime(self, timeInSeconds):
|
||||||
value = round(value)
|
value = round(timeInSeconds)
|
||||||
weeks = value // 604800
|
weeks = timeInSeconds // 604800
|
||||||
days = (value % 604800) // 86400
|
days = (timeInSeconds % 604800) // 86400
|
||||||
hours = (value % 86400) // 3600
|
hours = (timeInSeconds % 86400) // 3600
|
||||||
minutes = (value % 3600) // 60
|
minutes = (timeInSeconds % 3600) // 60
|
||||||
seconds = value % 60
|
seconds = timeInSeconds % 60
|
||||||
if(weeks > 0):
|
if(weeks > 0):
|
||||||
return '{0:.0f}w, {1:.0f}d, {2:02.0f}:{3:02.0f}:{4:02.0f}'.format(weeks, days, hours, minutes, seconds)
|
return '{0:.0f}w, {1:.0f}d, {2:02.0f}:{3:02.0f}:{4:02.0f}'.format(weeks, days, hours, minutes, seconds)
|
||||||
elif(days > 0):
|
elif(days > 0):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user