post-processing script not receiving args?
Posted: November 22nd, 2009, 1:02 pm
I'm attempting to write my first post-processing script. I'm writing it in Python, on a windows machine ... according to the sabnzbd history the script is executing and the output is being dumped to the log file. However, none of the arguments that sabnzbd says it will pass are being passed over ... the only argument found in sys.argv is the path of the script itself.
Am I missing something here?
This scripts log output simply shows:
I've tested this script from the command line using: "python myscript.py a b c d e f" and it works just fine ...
Are there any 'hello world' style script examples that show the bare basics, or some sort of script template ... or other form of requirement that I am missing? The docs basically just say that the specified number of parameters are passed, some may be empty values ... and then explains what each parameter is, but I can't seem to find anything more in-depth.
Am I missing something here?
Code: Select all
import sys
def main():
print 'Executing ...'
print sys.argv
if len(sys.argv) > 1:
print 'Parameters passed.'
for p in sys.argv:
print "Argument: " + p
print 'Exitting ...'
sys.exit(0)
main()
Code: Select all
Executing ...
['path/to/myscript.py']
Exitting ...
Are there any 'hello world' style script examples that show the bare basics, or some sort of script template ... or other form of requirement that I am missing? The docs basically just say that the specified number of parameters are passed, some may be empty values ... and then explains what each parameter is, but I can't seem to find anything more in-depth.