From 5c1223adfb12b1aefe4387bbf3222ae3adec920e Mon Sep 17 00:00:00 2001 From: Jesse Mullan Date: Mon, 27 Oct 2014 10:16:43 -0700 Subject: [PATCH 1/3] Fix argument to turn SSL cert checking on and off --- headphones/request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/request.py b/headphones/request.py index fba15baf..23594a31 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -47,7 +47,7 @@ def request_response(url, method="get", auto_raise=True, # Disable verification of SSL certificates if requested. Note: this could # pose a security issue! - kwargs["verify"] = headphones.CONFIG.VERIFY_SSL_CERT + kwargs["verify"] = bool(headphones.CONFIG.VERIFY_SSL_CERT) # Map method to the request.XXX method. This is a simple hack, but it allows # requests to apply more magic per method. See lib/requests/api.py. @@ -235,4 +235,4 @@ def server_message(response): if len(message) > 150: message = message[:150] + "..." - logger.debug("Server responded with message: %s", message) \ No newline at end of file + logger.debug("Server responded with message: %s", message) From 8d7fd835a8130cf9ca1cb10e3b14be02c2245a7a Mon Sep 17 00:00:00 2001 From: Jesse Mullan Date: Tue, 28 Oct 2014 11:22:43 -0700 Subject: [PATCH 2/3] Fix global of CURRENT_VERSION + other things that pylint points out --- headphones/__init__.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/headphones/__init__.py b/headphones/__init__.py index 8e0cd82c..d290cf21 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -50,6 +50,7 @@ POSSIBLE_EXTRAS = [ ] PROG_DIR = None +FULL_PATH = None ARGS = None SIGNAL = None @@ -66,7 +67,7 @@ PIDFILE= None SCHED = BackgroundScheduler() INIT_LOCK = threading.Lock() -__INITIALIZED__ = False +_INITIALIZED = False started = False DATA_DIR = None @@ -95,15 +96,16 @@ def initialize(config_file): with INIT_LOCK: global CONFIG - global __INITIALIZED__ - global EXTRA_NEWZNABS + global _INITIALIZED + global CURRENT_VERSION global LATEST_VERSION + global UMASK CONFIG = headphones.config.Config(config_file) assert CONFIG is not None - if __INITIALIZED__: + if _INITIALIZED: return False if CONFIG.HTTP_PORT < 21 or CONFIG.HTTP_PORT > 65535: @@ -167,7 +169,7 @@ def initialize(config_file): UMASK = os.umask(0) os.umask(UMASK) - __INITIALIZED__ = True + _INITIALIZED = True return True def daemonize(): @@ -239,9 +241,9 @@ def launch_browser(host, port, root): def start(): - global __INITIALIZED__, started + global started - if __INITIALIZED__: + if _INITIALIZED: # Start our scheduled background tasks from headphones import updater, searcher, librarysync, postprocessor, torrentfinished @@ -446,8 +448,8 @@ def dbcheck(): except sqlite3.OperationalError: c.execute('ALTER TABLE artists ADD COLUMN Extras TEXT DEFAULT NULL') # Need to update some stuff when people are upgrading and have 'include extras' set globally/for an artist - if INCLUDE_EXTRAS: - EXTRAS = "1,2,3,4,5,6,7,8" + if CONFIG.INCLUDE_EXTRAS: + CONFIG.EXTRAS = "1,2,3,4,5,6,7,8" logger.info("Copying over current artist IncludeExtras information") artists = c.execute('SELECT ArtistID, IncludeExtras from artists').fetchall() for artist in artists: From b0c7c8b682db534504d44bc3603e2d159d124f0b Mon Sep 17 00:00:00 2001 From: Jesse Mullan Date: Wed, 29 Oct 2014 07:13:44 -0700 Subject: [PATCH 3/3] Fix various config keys and template config keys to round trip more data --- data/interfaces/default/config.html | 42 +++++++++++------------ headphones/config.py | 16 +++++---- headphones/webserve.py | 53 +++++++++++++++-------------- 3 files changed, 57 insertions(+), 54 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 97aacb60..beb3697a 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -50,13 +50,13 @@ - +
- +
@@ -166,25 +166,25 @@ - +
- +
- +
- +
@@ -200,19 +200,19 @@ - +
- +
- +
<% if config['nzbget_priority'] == -100: @@ -348,11 +348,11 @@
- +
- +
Note: With Transmission, you can specify a different download directory for downloads sent from Headphones. @@ -368,11 +368,11 @@
- +
- +
@@ -445,7 +445,7 @@
- +
@@ -667,15 +667,15 @@
Target bitrate - kbps
+ kbps
- Reject if less than % or more than % of the target size (leave blank for no limit)
+ Reject if less than % or more than % of the target size (leave blank for no limit)
- +
@@ -762,12 +762,12 @@
- + e.g. /Users/name/Music/iTunes or /Volumes/share/music
- + Set this if you have a separate directory for lossless music
@@ -1258,7 +1258,7 @@
- +
@@ -1367,7 +1367,7 @@