def main(argv):
global options<EOL>opts = None<EOL>try:<EOL><INDENT>opts, args = getopt.getopt(argv, options['<STR_LIT>'], options['<STR_LIT>'])<EOL><DEDENT>except getopt.GetoptError:<EOL><INDENT>usage()<EOL>exit(<NUM_LIT:2>)<EOL><DEDENT>for opt, arg in opts:<EOL><INDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>usage()<EOL>exit()<EOL><DEDENT>elif opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>try:<EOL><INDENT>arg = int(arg)<EOL>log.debug("<STR_LIT>" + str(arg))<EOL><DEDENT>except ValueError:<EOL><INDENT>log.warning("<STR_LIT>" + arg)<EOL>continue<EOL><DEDENT>if <NUM_LIT:0> <= arg <= <NUM_LIT:5>:<EOL><INDENT>log.setLevel(<NUM_LIT> - (arg*<NUM_LIT:10>))<EOL>log.critical("<STR_LIT>" + str(logging.getLevelName(<NUM_LIT> - (arg*<NUM_LIT:10>))))<EOL><DEDENT>else:<EOL><INDENT>log.warning("<STR_LIT>" + str(arg))<EOL><DEDENT><DEDENT><DEDENT>infile = None<EOL>outfile = None<EOL>remove_background = False<EOL>duration_format = False<EOL>deduplicate = False<EOL>for opt, arg in opts:<EOL><INDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>log.info("<STR_LIT>" + arg)<EOL>infile = arg<EOL><DEDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>log.info("<STR_LIT>" + arg)<EOL>outfile = arg<EOL><DEDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>log.info("<STR_LIT>")<EOL>remove_background = True<EOL><DEDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>log.info("<STR_LIT>")<EOL>duration_format = True<EOL><DEDENT>if opt in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>log.info("<STR_LIT>")<EOL>deduplicate = True<EOL><DEDENT><DEDENT>if infile is None:<EOL><INDENT>log.critical("<STR_LIT>")<EOL>usage()<EOL>exit(<NUM_LIT:3>)<EOL><DEDENT>with open(infile) as f:<EOL><INDENT>cucumber_output = convert(json.load(f),<EOL>remove_background=remove_background,<EOL>duration_format=duration_format,<EOL>deduplicate=deduplicate)<EOL><DEDENT>if outfile is not None:<EOL><INDENT>with open(outfile, '<STR_LIT:w>') as f:<EOL><INDENT>json.dump(cucumber_output, f, indent=<NUM_LIT:4>, separators=('<STR_LIT:U+002C>', '<STR_LIT>'))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>pprint(cucumber_output)<EOL><DEDENT>
Main