[Console] Removed Core dependency from Console UI

UIs should not depend on core directly, so removing the dependency in ConsoleUI.
This is done by adding a hard-coded variable.

Closes https://dev.deluge-torrent.org/ticket/3491
Closes: https://github.com/deluge-torrent/deluge/pull/320
This commit is contained in:
DjLegolas 2021-12-21 20:58:18 +02:00 committed by Calum Lind
parent 88ffd1b843
commit a2d0cb7141
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 3 additions and 2 deletions

View File

@ -11,9 +11,10 @@ from __future__ import unicode_literals
import deluge.common
import deluge.component as component
from deluge.core.preferencesmanager import DEFAULT_PREFS
from deluge.ui.client import client
DEFAULT_DAEMON_PORT = 58846
class StatusBars(component.Component):
def __init__(self):
@ -76,7 +77,7 @@ class StatusBars(component.Component):
connection_info += '{!white,blue,bold!}@{!red,blue,bold!}%s'
# Port
if info[1] == DEFAULT_PREFS['daemon_port']:
if info[1] == DEFAULT_DAEMON_PORT:
connection_info += '{!white,blue!}:%s'
else:
connection_info += '{!status!}:%s'