(dictory)
| 43 | time.sleep(0.1) |
| 44 | |
| 45 | def trigger_bootstrap(dictory): |
| 46 | data = [] |
| 47 | for root, dirs, files in os.walk(dictory): |
| 48 | for f in sorted(files): |
| 49 | pattern = re.compile(r"^run.*?toml$") |
| 50 | # pattern = re.compile(r"^run48.toml$") |
| 51 | if pattern.match(f) is not None: |
| 52 | log_path = "{}/{}.txt".format(dictory, f) |
| 53 | cmd = "python bootstrap.py -f {} {} > {}".format( |
| 54 | os.path.join(root, f), str(arguments), log_path) |
| 55 | sys_command_outstatuserr(cmd, timeout=600) |
| 56 | |
| 57 | if len(filter) > 0: |
| 58 | trace = "" |
| 59 | try: |
| 60 | trace = int(f.split("-")[1].split(".")[0]) |
| 61 | except: |
| 62 | trace = str(f.split("-")[1].split(".")[0]) |
| 63 | print("trace {}".format(trace)) |
| 64 | |
| 65 | print_process = Popen(("cat {}".format(os.path.join(root,f + ".txt")).split()), stdout=subprocess.PIPE) |
| 66 | grep_process = Popen(["grep", "-i", filter], stdin=print_process.stdout, stdout=PIPE) |
| 67 | print_process.stdout.close() # Allow ps_process to receive a SIGPIPE if grep_process exits. |
| 68 | output = grep_process.communicate()[0] |
| 69 | |
| 70 | print(output.decode('utf-8')) |
| 71 | data.append([trace,output.decode('utf-8') ]) |
| 72 | |
| 73 | print('finish\n-------\n', f) |
| 74 | |
| 75 | print(tabulate(sorted(data), headers=["trace","data"])) |
| 76 | |
| 77 | if __name__ == '__main__': |
| 78 | trigger_bootstrap(input_dir) |
no test coverage detected