mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Automatically attempt to get localclient auth when setting core uri to localhost
This commit is contained in:
parent
69e2154004
commit
fcc975006a
1 changed files with 6 additions and 0 deletions
|
@ -309,6 +309,12 @@ class BaseClient(object):
|
||||||
|
|
||||||
def set_core_uri(self, uri='http://localhost:58846'):
|
def set_core_uri(self, uri='http://localhost:58846'):
|
||||||
"""Sets the core uri"""
|
"""Sets the core uri"""
|
||||||
|
if uri:
|
||||||
|
# Check if we need to get the localclient auth password
|
||||||
|
u = urlparse.urlsplit(uri)
|
||||||
|
if (u.hostname == "localhost" or u.hostname == "127.0.0.1") and not u.username:
|
||||||
|
from deluge.ui.common import get_localhost_auth_uri
|
||||||
|
uri = get_localhost_auth_uri(uri)
|
||||||
return self.core.set_core_uri(uri)
|
return self.core.set_core_uri(uri)
|
||||||
|
|
||||||
def connected(self):
|
def connected(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue