def main(): parser = OptionParser(usage="usage: %prog [options] [jobid]") parser.add_option('--chanid', action='store', type='int', dest='chanid', help='Use chanid for manual operation') parser.add_option('--starttime', action='store', type='int', dest='starttime', help='Use starttime for manual operation') #MythLog.loadOptParse(parser) #MythLog._optparseinput() MythLog._setpath('/tmp') opts, args = parser.parse_args() j = TranscodeJob() try: if len(args) == 1: j.run(jobid=args[0]) elif opts.chanid and opts.starttime: j.run(chanid=opts.chanid, starttime=opts.starttime) else: print 'Script must be provided jobid, or chanid and starttime.' sys.exit(1) except: j.logTB() sys.exit(1)