Added Global Constants and Changed Whitespace

-Increasing use of global constants to make it easier when having to make alterations to multiple files.
-Some of the tabs where causing issues, as they would change into 8 spaces upon execution and python would complain about the indenting (as it would now be a mixture of 4 spaces and 8 spaces).  This has been changed to just use spaces.
-Renamed nzbToGamez to include python extention
-Made all nzbTo files that are supposed to be executable, executable
This commit is contained in:
ajw107 2013-03-07 11:56:54 +00:00 committed by Alex Wood
commit 2bf1240565
6 changed files with 86 additions and 87 deletions

View file

@ -36,27 +36,25 @@ Logger.info("====================") # Seperate old from new log
Logger.info("nzbToSickBeard %s", VERSION)
# SABnzbd
if len(sys.argv) == 8:
# SABnzbd argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 Clean version of the job name (no path info and ".nzb" removed)
# 4 Indexer's report number (if supported)
# 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
if len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 Clean version of the job name (no path info and ".nzb" removed)
# 4 Indexer's report number (if supported)
# 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessTV...")
result = autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
# NZBGet
elif len(sys.argv) == 4:
# NZBGet argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 The status of the download: 0 == successful
elif len(sys.argv) == NZBGET_NO_OF_ARGUMENTS:
# NZBGet argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 The status of the download: 0 == successful
Logger.info("Script triggered from NZBGet, starting autoProcessTV...")
result = autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3])
else:
Logger.debug("Invalid number of arguments received from client.")
Logger.info("Running autoProcessTV as a manual run...")