From f961c476aefbc99abaa8ae50799efc97b177661f Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Sat, 19 Jan 2019 14:06:06 -0500 Subject: [PATCH] Refactor transmission configuration --- core/__init__.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index 2ad98d34..a8fd8d89 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -423,6 +423,18 @@ def configure_groups(): GROUPS = None +def configure_transmission(): + global TRANSMISSION_HOST + global TRANSMISSION_PORT + global TRANSMISSION_USER + global TRANSMISSION_PASSWORD + + TRANSMISSION_HOST = CFG['Torrent']['TransmissionHost'] # localhost + TRANSMISSION_PORT = int(CFG['Torrent']['TransmissionPort']) + TRANSMISSION_USER = CFG['Torrent']['TransmissionUSR'] # mysecretusr + TRANSMISSION_PASSWORD = CFG['Torrent']['TransmissionPWD'] # mysecretpwr + + def configure_torrents(): global TORRENT_CLIENT_AGENT global USE_LINK @@ -437,10 +449,6 @@ def configure_torrents(): global UTORRENT_WEB_UI global UTORRENT_USER global UTORRENT_PASSWORD - global TRANSMISSION_HOST - global TRANSMISSION_PORT - global TRANSMISSION_USER - global TRANSMISSION_PASSWORD global DELUGE_HOST global DELUGE_PORT global DELUGE_USER @@ -468,10 +476,7 @@ def configure_torrents(): UTORRENT_USER = CFG['Torrent']['uTorrentUSR'] # mysecretusr UTORRENT_PASSWORD = CFG['Torrent']['uTorrentPWD'] # mysecretpwr - TRANSMISSION_HOST = CFG['Torrent']['TransmissionHost'] # localhost - TRANSMISSION_PORT = int(CFG['Torrent']['TransmissionPort']) - TRANSMISSION_USER = CFG['Torrent']['TransmissionUSR'] # mysecretusr - TRANSMISSION_PASSWORD = CFG['Torrent']['TransmissionPWD'] # mysecretpwr + configure_transmission() DELUGE_HOST = CFG['Torrent']['DelugeHost'] # localhost DELUGE_PORT = int(CFG['Torrent']['DelugePort']) # 8084