diff options
author | Andrew Resch <andrewresch@gmail.com> | 2010-01-03 01:37:57 +0000 |
---|---|---|
committer | Andrew Resch <andrewresch@gmail.com> | 2010-01-03 01:37:57 +0000 |
commit | d5a11d0e953de6af31cf29156cacf56e408b4496 (patch) | |
tree | faed60c8ebde7a84f9c2dcec662236e612f4213a | |
parent | 1f8919b47f09edd04004271b162a38e3194e4bc7 (diff) | |
download | deluge-d5a11d0e953de6af31cf29156cacf56e408b4496.tar.gz deluge-d5a11d0e953de6af31cf29156cacf56e408b4496.tar.bz2 deluge-d5a11d0e953de6af31cf29156cacf56e408b4496.zip |
Fix #1116 not being able to use command aliases when not connected to a daemon
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | deluge/ui/console/main.py | 9 |
2 files changed, 9 insertions, 1 deletions
@@ -14,6 +14,7 @@ ==== Console ==== * Fix #1115 not showing usage for the 'debug' command + * Fix #1116 not being able to use command aliases when not connected to a daemon ==== Windows ==== * Fix displaying folders in the add torrent dialog diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 68fb3bba1..5bf8df9f8 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -295,7 +295,14 @@ class ConsoleUI(component.Component): parser._print_help(f) parser.print_help = print_help - if not client.connected() and cmd not in ("help", "connect", "quit"): + # Only these commands can be run when not connected to a daemon + not_connected_cmds = ["help", "connect", "quit"] + aliases = [] + for c in not_connected_cmds: + aliases.extend(self._commands[c].aliases) + not_connected_cmds.extend(aliases) + + if not client.connected() and cmd not in not_connected_cmds: self.write("{!error!}Not connected to a daemon, please use the connect command first.") return |