Show an error message when trying to do an operation while disconnected from a deluge daemon.

This commit is contained in:
Sadrul Habib Chowdhury 2008-02-10 14:12:14 +00:00
parent 72cb14f1d7
commit 76da1ac525
1 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@ deluge-shell: Deluge shell.
import deluge.ui.client as client import deluge.ui.client as client
import deluge.common as common import deluge.common as common
import deluge.error
import readline import readline
import logging import logging
@ -338,7 +339,13 @@ class NullUI:
commands['help'].execute([]) commands['help'].execute([])
else: else:
command = commands[cmd] command = commands[cmd]
try:
command.execute(inp) command.execute(inp)
client.force_call() client.force_call()
except deluge.error.NoCoreError, e:
print "*** Operation failed. You are not connected to a deluge daemon."
print " Perhaps you want to 'connect' first."
print ""
print "Thanks." print "Thanks."