Added main program arguments
This commit is contained in:
26
TVEncoder.py
26
TVEncoder.py
@@ -5,3 +5,29 @@ Created on Fri Jul 5 14:14:22 2013
|
|||||||
@author: shanef
|
@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 <number of files to process> - processes n recordings'
|
||||||
|
print 'TVEncoder.py -l -n <number of files to process> - 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 <number of files to process> - processes n recordings'
|
||||||
|
print 'TVEncoder.py -l -n <number of files to process> - 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:])
|
||||||
Reference in New Issue
Block a user