From a570e67a4d8324ae0240b2ed740b3f4460916f8e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 3 Jan 2010 01:37:57 +0000 Subject: [PATCH] Fix #1116 not being able to use command aliases when not connected to a daemon --- deluge/ui/console/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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