Module: deluge
Branch: 1.3-stable
Commit: 6fa2728ddcf5ad45165f23abfb617b9430ce9733

Author: Eirik Byrkjeflot Anonsen <[email protected]>
Date:   Tue May 17 20:51:50 2011 +0200

Add seeding_time, active_time and tracker_status to deluge-console's "info" 
command.

---

 deluge/ui/console/commands/info.py |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/deluge/ui/console/commands/info.py 
b/deluge/ui/console/commands/info.py
index 7852399..1877e60 100644
--- a/deluge/ui/console/commands/info.py
+++ b/deluge/ui/console/commands/info.py
@@ -46,6 +46,7 @@ import deluge.component as component
 status_keys = ["state",
         "save_path",
         "tracker",
+        "tracker_status",
         "next_announce",
         "name",
         "total_size",
@@ -67,7 +68,9 @@ status_keys = ["state",
         "file_progress",
         "peers",
         "is_seed",
-        "is_finished"
+        "is_finished",
+        "active_time",
+        "seeding_time"
         ]
 
 
@@ -89,6 +92,16 @@ def format_progressbar(progress, width):
     s += "]"
     return s
 
+def format_time(seconds):
+    minutes = seconds // 60
+    seconds = seconds - minutes * 60
+    hours = minutes // 60
+    minutes = minutes - hours * 60
+    days = hours // 24
+    hours = hours - days * 24
+    return "%d days %02d:%02d:%02d" % (days, hours, minutes, seconds)
+
+
 
 class Command(BaseCommand):
     """Show information about the torrents"""
@@ -163,6 +176,11 @@ class Command(BaseCommand):
         s += " {!info!}Ratio: {!input!}%.3f" % status["ratio"]
         self.console.write(s)
 
+        s = "{!info!}Seed time: {!input!}%s" % 
format_time(status["seeding_time"])
+        s += " {!info!}Active: {!input!}%s" % 
format_time(status["active_time"])
+        self.console.write(s)
+        self.console.write("{!info!}Tracker status: {!input!}%s" % 
status["tracker_status"])
+
         if not status["is_finished"]:
             if hasattr(self.console, "screen"):
                 cols = self.console.screen.cols

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to