mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-10 02:18:41 +00:00
Fix #619 return "" instead of "Infinity" if seconds == 0 in ftime
This commit is contained in:
parent
34671971be
commit
d7a76b3b5a
1 changed files with 2 additions and 2 deletions
|
@ -284,7 +284,7 @@ def ftime(seconds):
|
||||||
Formats a string to show time in a human readable form
|
Formats a string to show time in a human readable form
|
||||||
|
|
||||||
:param seconds: int, the number of seconds
|
:param seconds: int, the number of seconds
|
||||||
:returns: a formatted time string, will return 'Infinity' if seconds == 0
|
:returns: a formatted time string, will return '' if seconds == 0
|
||||||
:rtype: string
|
:rtype: string
|
||||||
|
|
||||||
**Usage**
|
**Usage**
|
||||||
|
@ -294,7 +294,7 @@ def ftime(seconds):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if seconds == 0:
|
if seconds == 0:
|
||||||
return "Infinity"
|
return ""
|
||||||
if seconds < 60:
|
if seconds < 60:
|
||||||
return '%ds' % (seconds)
|
return '%ds' % (seconds)
|
||||||
minutes = seconds / 60
|
minutes = seconds / 60
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue