mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Add seeding_time, active_time and tracker_status to deluge-console's "info" command.
This commit is contained in:
parent
35f7526c2a
commit
79023eb5c6
@ -50,6 +50,7 @@ from os.path import sep as dirsep
|
|||||||
STATUS_KEYS = ["state",
|
STATUS_KEYS = ["state",
|
||||||
"download_location",
|
"download_location",
|
||||||
"tracker",
|
"tracker",
|
||||||
|
"tracker_status",
|
||||||
"next_announce",
|
"next_announce",
|
||||||
"name",
|
"name",
|
||||||
"total_size",
|
"total_size",
|
||||||
@ -71,7 +72,9 @@ STATUS_KEYS = ["state",
|
|||||||
"file_progress",
|
"file_progress",
|
||||||
"peers",
|
"peers",
|
||||||
"is_seed",
|
"is_seed",
|
||||||
"is_finished"
|
"is_finished",
|
||||||
|
"active_time",
|
||||||
|
"seeding_time"
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add filter specific state to torrent states
|
# Add filter specific state to torrent states
|
||||||
@ -95,6 +98,17 @@ def format_progressbar(progress, width):
|
|||||||
s += "]"
|
s += "]"
|
||||||
return 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):
|
class Command(BaseCommand):
|
||||||
"""Show information about the torrents"""
|
"""Show information about the torrents"""
|
||||||
|
|
||||||
@ -311,9 +325,14 @@ class Command(BaseCommand):
|
|||||||
s += " {!info!}Uploaded: {!input!}%s" % common.fsize(status["ratio"] * status["total_done"])
|
s += " {!info!}Uploaded: {!input!}%s" % common.fsize(status["ratio"] * status["total_done"])
|
||||||
self.console.write(s)
|
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)
|
||||||
|
|
||||||
s = "{!info!}Tracker: {!input!}%s" % status["tracker"]
|
s = "{!info!}Tracker: {!input!}%s" % status["tracker"]
|
||||||
self.console.write(s)
|
self.console.write(s)
|
||||||
|
|
||||||
|
self.console.write("{!info!}Tracker status: {!input!}%s" % status["tracker_status"])
|
||||||
|
|
||||||
if not status["is_finished"]:
|
if not status["is_finished"]:
|
||||||
pbar = format_progressbar(status["progress"], cols - (13 + len("%.2f%%" % status["progress"])))
|
pbar = format_progressbar(status["progress"], cols - (13 + len("%.2f%%" % status["progress"])))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user