summaryrefslogtreecommitdiffstats
path: root/deluge/ui/common.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2017-03-30 00:36:44 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2017-06-07 12:36:09 +0100
commitac48ad982ec4923731b9d25dd8fdaea28c6a9042 (patch)
tree19f4d72f51c1d50381e10ce7212522e585137662 /deluge/ui/common.py
parent54a081bdfd73b046a31b4d960b0f7ad75018d1be (diff)
downloaddeluge-ac48ad982ec4923731b9d25dd8fdaea28c6a9042.tar.gz
deluge-ac48ad982ec4923731b9d25dd8fdaea28c6a9042.tar.bz2
deluge-ac48ad982ec4923731b9d25dd8fdaea28c6a9042.zip
[UI] Refactor duplicated code out of connection managers
Diffstat (limited to 'deluge/ui/common.py')
-rw-r--r--deluge/ui/common.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/deluge/ui/common.py b/deluge/ui/common.py
index ef7dda9af..c66e8eb27 100644
--- a/deluge/ui/common.py
+++ b/deluge/ui/common.py
@@ -15,10 +15,8 @@ from __future__ import unicode_literals
import logging
import os
-import time
from hashlib import sha1 as sha
-import deluge.configmanager
from deluge import bencode
from deluge.common import decode_bytes
@@ -163,12 +161,6 @@ FILE_PRIORITY = {
del _
-DEFAULT_HOST = '127.0.0.1'
-DEFAULT_PORT = 58846
-DEFAULT_HOSTS = {
- 'hosts': [(sha(str(time.time()).encode('utf8')).hexdigest(), DEFAULT_HOST, DEFAULT_PORT, '', '')]
-}
-
# The keys from session statistics for cache status.
DISK_CACHE_KEYS = [
'disk.num_blocks_read', 'disk.num_blocks_written', 'disk.num_read_ops', 'disk.num_write_ops',
@@ -533,36 +525,3 @@ class FileTree(object):
lines.append(' ' * depth + path)
self.walk(write)
return '\n'.join(lines)
-
-
-def get_localhost_auth():
- """
- Grabs the localclient auth line from the 'auth' file and creates a localhost uri
-
- :returns: with the username and password to login as
- :rtype: tuple
- """
- auth_file = deluge.configmanager.get_config_dir('auth')
- if not os.path.exists(auth_file):
- from deluge.common import create_localclient_account
- create_localclient_account()
-
- with open(auth_file) as auth:
- for line in auth:
- line = line.strip()
- if line.startswith('#') or not line:
- # This is a comment or blank line
- continue
-
- lsplit = line.split(':')
-
- if len(lsplit) == 2:
- username, password = lsplit
- elif len(lsplit) == 3:
- username, password, level = lsplit
- else:
- log.error('Your auth file is malformed: Incorrect number of fields!')
- continue
-
- if username == 'localclient':
- return (username, password)