def main():
usage = "<STR_LIT>"<EOL>parser = optparse.OptionParser(usage=usage)<EOL>parser.add_option(<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>action="<STR_LIT:store_true>", dest="<STR_LIT>", default=False,<EOL>help="<STR_LIT>")<EOL>parser.add_option(<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>action="<STR_LIT:store>", type="<STR_LIT:string>", dest="<STR_LIT>",<EOL>default='<STR_LIT>',<EOL>help="<STR_LIT>")<EOL>parser.add_option(<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>action="<STR_LIT:store>", type="<STR_LIT:string>", dest="<STR_LIT>",<EOL>default='<STR_LIT>',<EOL>help=("<STR_LIT>" +<EOL>"<STR_LIT>"))<EOL>(options, args) = parser.parse_args()<EOL>if options.verbose:<EOL><INDENT>log_level = logging.DEBUG<EOL><DEDENT>else:<EOL><INDENT>log_level = logging.INFO<EOL><DEDENT>logging.basicConfig(level=log_level,<EOL>format="<STR_LIT>")<EOL>curdir = os.getcwd()<EOL>testbinary = os.path.join(curdir, '<STR_LIT>', '<STR_LIT:test>')<EOL>if not os.path.exists(testbinary):<EOL><INDENT>raise RuntimeError("<STR_LIT>" % testbinary)<EOL><DEDENT>coveragebinary = os.path.join(curdir, '<STR_LIT>', '<STR_LIT>')<EOL>if not os.path.exists(coveragebinary):<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>coveragebinary = '<STR_LIT>'<EOL><DEDENT>logger.info("<STR_LIT>")<EOL>parts = [coveragebinary, '<STR_LIT>', testbinary]<EOL>if options.test_args:<EOL><INDENT>parts.append(options.test_args)<EOL><DEDENT>system("<STR_LIT:U+0020>".join(parts))<EOL>logger.debug("<STR_LIT>")<EOL>if options.output_dir:<EOL><INDENT>coverage_dir = options.output_dir<EOL>open_in_browser = False<EOL><DEDENT>else:<EOL><INDENT>coverage_dir = '<STR_LIT>'  <EOL>open_in_browser = True<EOL><DEDENT>system("<STR_LIT>" % (coveragebinary, coverage_dir))<EOL>logger.info("<STR_LIT>", coverage_dir)<EOL>if open_in_browser:<EOL><INDENT>index_file = os.path.abspath(<EOL>os.path.join(coverage_dir, '<STR_LIT>'))<EOL>logger.debug("<STR_LIT>", index_file)<EOL>webbrowser.open('<STR_LIT>' + index_file)<EOL>logger.info("<STR_LIT>")<EOL><DEDENT>
Create coverage reports and open them in the browser.