Massive changes to the way we handle our config, its now loaded and stored in memory so that we don't keep loading it and possibly get corrupt values.

New logger class added,logger options removed from settings.
This commit is contained in:
echel0n 2014-04-11 20:09:00 -07:00
parent d8a3bdb7dc
commit 18926d1db8
30 changed files with 1603 additions and 1058 deletions

View file

@ -62,13 +62,13 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
if os.environ['NZBOP_UNPACK'] != 'yes':
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_ERROR)
# Check par status
if os.environ['NZBPP_PARSTATUS'] == '3':
print "Par-check successful, but Par-repair disabled, exiting."
print "Please check your Par-repair settings for future downloads."
sys.exit(config.NZBGET_POSTPROCESS_NONE)
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_NONE)
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
print "Par-repair failed, setting status \"failed\"."
@ -99,7 +99,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script.
if status == 1:
sys.exit(config.NZBGET_POSTPROCESS_NONE)
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_NONE)
mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',')
SampleIDs = os.environ['NZBPO_SAMPLEIDS'].split(',')
@ -116,8 +116,8 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
os.unlink(filePath)
except:
print "Error: unable to delete file", filePath
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_ERROR)
sys.exit(nzbtomedia.NZBGET_POSTPROCESS_SUCCESS)
else:
print "This script can only be called from NZBGet (11.0 or later)."