Fix the quit command

This commit is contained in:
Andrew Resch 2009-04-20 03:51:15 +00:00
parent b3ee54fcdc
commit 7bdf8bffd8

View File

@ -24,10 +24,13 @@
# #
from deluge.ui.client import client from deluge.ui.client import client
from deluge.ui.console.main import BaseCommand from deluge.ui.console.main import BaseCommand
from twisted.internet import reactor
class Command(BaseCommand): class Command(BaseCommand):
"""Exit from the client.""" """Exit from the client."""
aliases = ['exit'] aliases = ['exit']
def handle(self, *args, **options): def handle(self, *args, **options):
print "Thanks!" if client.connected():
raise StopIteration def on_disconnect(result):
reactor.stop()
client.disconnect().addCallback(on_disconnect)