From e006c455678b7e05b81d1f86af185e9d4b94a2e0 Mon Sep 17 00:00:00 2001 From: Shane Frischkorn Date: Fri, 5 Jul 2013 15:35:12 +1000 Subject: [PATCH] Added main program arguments --- TVEncoder.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/TVEncoder.py b/TVEncoder.py index bb11bc6..6dc3e5a 100644 --- a/TVEncoder.py +++ b/TVEncoder.py @@ -5,3 +5,29 @@ Created on Fri Jul 5 14:14:22 2013 @author: shanef """ +import sys +import getopt + +def main(argv): + numFiles = 0 + doEncode = True + try: + opts, args = getopt.getopt(argv,"hn:l") + except getopt.GetoptError: + print 'TVEncoder.py -n - processes n recordings' + print 'TVEncoder.py -l -n - lists the files that will be processed without actually encoding them' + sys.exit(2) + for opt, arg in opts: + if opt == '-h': + print 'TVEncoder.py -n - processes n recordings' + print 'TVEncoder.py -l -n - lists the files that will be processed without actually encoding them' + sys.exit() + elif opt == "-n": + numFiles = arg + elif opt == "-l"): + doEncode = True + + print "Get to work" + +if __name__ == "__main__": + main(sys.argv[1:]) \ No newline at end of file