From 7bdf8bffd8c84602d5fd5a9cc7edf3d47d6cbea4 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 20 Apr 2009 03:51:15 +0000 Subject: [PATCH] Fix the quit command --- deluge/ui/console/commands/quit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/commands/quit.py b/deluge/ui/console/commands/quit.py index 87547e674..7053604d3 100644 --- a/deluge/ui/console/commands/quit.py +++ b/deluge/ui/console/commands/quit.py @@ -24,10 +24,13 @@ # from deluge.ui.client import client from deluge.ui.console.main import BaseCommand +from twisted.internet import reactor class Command(BaseCommand): """Exit from the client.""" aliases = ['exit'] def handle(self, *args, **options): - print "Thanks!" - raise StopIteration + if client.connected(): + def on_disconnect(result): + reactor.stop() + client.disconnect().addCallback(on_disconnect)