Added main program arguments
This commit is contained in:
parent
ad5a3d4865
commit
e006c45567
1 changed files with 26 additions and 0 deletions
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:])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue