mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
PEP8 Argument should be lowercase
This commit is contained in:
parent
7f2a4d2605
commit
41fa636fc2
15 changed files with 326 additions and 350 deletions
|
@ -7,11 +7,11 @@ import core
|
|||
from core import logger
|
||||
|
||||
|
||||
def auto_fork(section, inputCategory):
|
||||
def auto_fork(section, input_category):
|
||||
# auto-detect correct section
|
||||
# config settings
|
||||
|
||||
cfg = dict(core.CFG[section][inputCategory])
|
||||
cfg = dict(core.CFG[section][input_category])
|
||||
|
||||
host = cfg.get("host")
|
||||
port = cfg.get("port")
|
||||
|
@ -31,26 +31,26 @@ def auto_fork(section, inputCategory):
|
|||
detected = False
|
||||
if section == "NzbDrone":
|
||||
logger.info("Attempting to verify {category} fork".format
|
||||
(category=inputCategory))
|
||||
(category=input_category))
|
||||
url = "{protocol}{host}:{port}{root}/api/rootfolder".format(
|
||||
protocol=protocol, host=host, port=port, root=web_root)
|
||||
headers = {"X-Api-Key": apikey}
|
||||
try:
|
||||
r = requests.get(url, headers=headers, stream=True, verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.warning("Could not connect to {0}:{1} to verify fork!".format(section, inputCategory))
|
||||
logger.warning("Could not connect to {0}:{1} to verify fork!".format(section, input_category))
|
||||
|
||||
if not r.ok:
|
||||
logger.warning("Connection to {section}:{category} failed! "
|
||||
"Check your configuration".format
|
||||
(section=section, category=inputCategory))
|
||||
(section=section, category=input_category))
|
||||
|
||||
fork = ['default', {}]
|
||||
|
||||
elif fork == "auto":
|
||||
params = core.ALL_FORKS
|
||||
rem_params = []
|
||||
logger.info("Attempting to auto-detect {category} fork".format(category=inputCategory))
|
||||
logger.info("Attempting to auto-detect {category} fork".format(category=input_category))
|
||||
# define the order to test. Default must be first since the default fork doesn't reject parameters.
|
||||
# then in order of most unique parameters.
|
||||
|
||||
|
@ -75,7 +75,7 @@ def auto_fork(section, inputCategory):
|
|||
r = s.get(url, auth=(username, password), verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.info("Could not connect to {section}:{category} to perform auto-fork detection!".format
|
||||
(section=section, category=inputCategory))
|
||||
(section=section, category=input_category))
|
||||
r = []
|
||||
if r and r.ok:
|
||||
if apikey:
|
||||
|
@ -99,16 +99,16 @@ def auto_fork(section, inputCategory):
|
|||
break
|
||||
if detected:
|
||||
logger.info("{section}:{category} fork auto-detection successful ...".format
|
||||
(section=section, category=inputCategory))
|
||||
(section=section, category=input_category))
|
||||
elif rem_params:
|
||||
logger.info("{section}:{category} fork auto-detection found custom params {params}".format
|
||||
(section=section, category=inputCategory, params=params))
|
||||
(section=section, category=input_category, params=params))
|
||||
fork = ['custom', params]
|
||||
else:
|
||||
logger.info("{section}:{category} fork auto-detection failed".format
|
||||
(section=section, category=inputCategory))
|
||||
(section=section, category=input_category))
|
||||
fork = core.FORKS.items()[core.FORKS.keys().index(core.FORK_DEFAULT)]
|
||||
|
||||
logger.info("{section}:{category} fork set to {fork}".format
|
||||
(section=section, category=inputCategory, fork=fork[0]))
|
||||
(section=section, category=input_category, fork=fork[0]))
|
||||
return fork[0], fork[1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue