mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix #1116 not being able to use command aliases when not connected to a daemon
This commit is contained in:
parent
1f8919b47f
commit
d5a11d0e95
2 changed files with 9 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
==== Console ====
|
==== Console ====
|
||||||
* Fix #1115 not showing usage for the 'debug' command
|
* 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 ====
|
==== Windows ====
|
||||||
* Fix displaying folders in the add torrent dialog
|
* Fix displaying folders in the add torrent dialog
|
||||||
|
|
|
@ -295,7 +295,14 @@ class ConsoleUI(component.Component):
|
||||||
parser._print_help(f)
|
parser._print_help(f)
|
||||||
parser.print_help = print_help
|
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.")
|
self.write("{!error!}Not connected to a daemon, please use the connect command first.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue