Replaced 'inf' with '-' for ratio column in AllTorrents mode
This commit is contained in:
parent
9c0c7b060c
commit
ae8751461a
|
@ -55,7 +55,7 @@ def format_time(time):
|
|||
|
||||
def format_float(x):
|
||||
if x < 0:
|
||||
return "inf"
|
||||
return "-"
|
||||
else:
|
||||
return "%.3f"%x
|
||||
|
||||
|
|
|
@ -453,7 +453,9 @@ class TorrentDetail(BaseMode, component.Component):
|
|||
s+= common.fsize(status["total_uploaded"])
|
||||
if status["upload_payload_rate"] > 0:
|
||||
s+= " {!yellow!}@ %s%s" % (up_color, common.fsize(status["upload_payload_rate"]))
|
||||
s+= " {!info!}Ratio: {!input!}%s" % format_utils.format_float(status["ratio"])
|
||||
ratio_str = format_utils.format_float(status["ratio"])
|
||||
if ratio_str == "-": ratio_str = "inf"
|
||||
s+= " {!info!}Ratio: {!input!}%s" % ratio_str
|
||||
self.add_string(off, s); off += 1
|
||||
|
||||
#Seeder/leecher info
|
||||
|
|
Loading…
Reference in New Issue