| 39 | return tool_path |
| 40 | |
| 41 | def parser(self, need_field=False): |
| 42 | tool_path = self.get_tool() |
| 43 | args = [ |
| 44 | "path=%s" % self.project_root, |
| 45 | "useapi=true", |
| 46 | "out=%s" % self.bc_db, |
| 47 | ] |
| 48 | if need_field: |
| 49 | logger.info("use field mode parser.") |
| 50 | args.append("field=true") |
| 51 | apifinder_cmd = __lu__().format_cmd(tool_path, args) |
| 52 | |
| 53 | try: |
| 54 | spc = SubProcController(apifinder_cmd, stdout_line_callback=subprocc_log, stderr_line_callback=subprocc_log) |
| 55 | if need_field: |
| 56 | spc.wait(60 * 60) |
| 57 | else: |
| 58 | spc.wait(20 * 60) |
| 59 | except ProcessExecuteTimeoutError: |
| 60 | logger.info("apifinder timeout.") |
| 61 | |
| 62 | |
| 63 | if __name__ == "__main__": |