From f9d0e4f620456194941066f2dea85d0a137f49b2 Mon Sep 17 00:00:00 2001
From: Calum Lind <calumlind+deluge@gmail.com>
Date: Tue, 9 Aug 2011 00:46:12 +0100
Subject: [PATCH] Fix auth issue with args passed to console
---
deluge/ui/console/commander.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/deluge/ui/console/commander.py b/deluge/ui/console/commander.py
index 21680c0..2b51da8 100644
a
|
b
|
def on_connect_fail(reason):
|
137 | 137 | print "Could not connect to: %s:%d\n %s"%(host,port,rm) |
138 | 138 | self.do_command("quit") |
139 | 139 | |
| 140 | if not username and host in ("127.0.0.1", "localhost"): |
| 141 | # No username was provided and it's the localhost, so we can try |
| 142 | # to grab the credentials from the auth file. |
| 143 | from deluge.ui.common import get_localhost_auth |
| 144 | username, password = get_localhost_auth() |
140 | 145 | if host: |
141 | 146 | d = client.connect(host,port,username,password) |
142 | 147 | else: |
143 | 148 | d = client.connect() |
144 | 149 | d.addCallback(on_connect) |
145 | 150 | d.addErrback(on_connect_fail) |
146 | | |