Monkey Patched our config class.

Fixed code for enabled check.
Tweaked a few things here and there.
This commit is contained in:
echel0n 2014-04-07 09:11:14 -07:00
commit 0ca0e43752
14 changed files with 72 additions and 82 deletions

View file

@ -81,10 +81,10 @@ from nzbtomedia.nzbToMediaConfig import config
from nzbtomedia.nzbToMediaUtil import get_dirnames, WakeUp, nzbtomedia_configure_logging
# run migrate to convert old cfg to new style cfg plus fix any cfg missing values/options.
if config.migrate():
if config().migrate():
# check to write settings from nzbGet UI to autoProcessMedia.cfg.
if os.environ.has_key('NZBOP_SCRIPTDIR'):
config.addnzbget()
config().addnzbget()
nzbtomedia_configure_logging(config.LOG_FILE)
Logger = logging.getLogger(__name__)
@ -173,12 +173,12 @@ else:
result = 0
# init sub-sections
subsections = config.get_subsections(["HeadPhones"])
subsections = config().get_subsections(["HeadPhones"])
Logger.warn("MAIN: Invalid number of arguments received from client.")
for section, subsection in subsections.items():
for category in subsection:
if config.isenabled(section, category):
if config().isenabled(section, category):
dirNames = get_dirnames(section, category)
for dirName in dirNames:
Logger.info("MAIN: nzbToHeadPhones running %s:%s as a manual run...", section, category)