From ae8751461aa860f26db323c746a618b32d5a0a09 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sat, 14 Jul 2012 12:54:40 +0200 Subject: [PATCH] Replaced 'inf' with '-' for ratio column in AllTorrents mode --- deluge/ui/console/modes/format_utils.py | 2 +- deluge/ui/console/modes/torrentdetail.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/modes/format_utils.py b/deluge/ui/console/modes/format_utils.py index bf218c9ec..0be4d41b5 100644 --- a/deluge/ui/console/modes/format_utils.py +++ b/deluge/ui/console/modes/format_utils.py @@ -55,7 +55,7 @@ def format_time(time): def format_float(x): if x < 0: - return "inf" + return "-" else: return "%.3f"%x diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py index 5aaed4605..0bca6a85a 100644 --- a/deluge/ui/console/modes/torrentdetail.py +++ b/deluge/ui/console/modes/torrentdetail.py @@ -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