From e32ce5b26568a34bfd99415a96fbb73a78b75801 Mon Sep 17 00:00:00 2001 From: Ido Abramovich Date: Wed, 24 Sep 2008 18:53:22 +0000 Subject: [PATCH] added 'all' subcommand to resume and pause, moved share ratio to general info view --- deluge/ui/null2/commands/info.py | 2 +- deluge/ui/null2/commands/pause.py | 7 ++++++- deluge/ui/null2/commands/resume.py | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/deluge/ui/null2/commands/info.py b/deluge/ui/null2/commands/info.py index aa0f978d2..25c81aed4 100644 --- a/deluge/ui/null2/commands/info.py +++ b/deluge/ui/null2/commands/info.py @@ -74,13 +74,13 @@ class Command(BaseCommand): print templates.info_transfers("Download Speed", common.fspeed(state['download_payload_rate'])) if state['state'] in ('Downloading', 'Seeding'): print templates.info_transfers("Upload Speed", common.fspeed(state['upload_payload_rate'])) + print templates.info_transfers("Share Ratio", "%.1f" % state['ratio']) if state['state'] == ('Downloading'): print templates.info_transfers("ETA", common.ftime(state['eta'])) if verbose: print templates.info_network("Seeders", "%s (%s)" % (state['num_seeds'], state['total_seeds'])) print templates.info_network("Peers", "%s (%s)" % (state['num_peers'], state['total_peers'])) - print templates.info_network("Share Ratio", "%.1f" % state['ratio']) print templates.info_network("Availability", "%.1f" % state['distributed_copies']) print templates.info_files_header("Files") for i, file in enumerate(state['files']): diff --git a/deluge/ui/null2/commands/pause.py b/deluge/ui/null2/commands/pause.py index 495cb00a3..57605b11b 100644 --- a/deluge/ui/null2/commands/pause.py +++ b/deluge/ui/null2/commands/pause.py @@ -6,8 +6,13 @@ from deluge.ui.null2.colors import templates, default_style as style class Command(BaseCommand): """Pause a torrent""" - usage = "Usage: pause [ ...]" + usage = "Usage: pause [ all | [ ...] ]" def handle(self, *args, **options): + if len(args) == 0: + print self.usage + return + if len(args) == 1 and args[0] == 'all': + args = tuple() # empty tuple means everything try: args = mapping.to_ids(args) torrents = match_torrents(args) diff --git a/deluge/ui/null2/commands/resume.py b/deluge/ui/null2/commands/resume.py index d3f7907fb..dd5ec2a78 100644 --- a/deluge/ui/null2/commands/resume.py +++ b/deluge/ui/null2/commands/resume.py @@ -6,8 +6,13 @@ from deluge.ui.null2.colors import templates, default_style as style class Command(BaseCommand): """Resume a torrent""" - usage = "Usage: resume [ ...]" + usage = "Usage: resume [ all | [ ...] ]" def handle(self, *args, **options): + if len(args) == 0: + print self.usage + return + if len(args) == 1 and args[0] == 'all': + args = tuple() # empty tuple means everything try: args = mapping.to_ids(args) torrents = match_torrents(args)