From 8c06d20757652b8daebc3c8b2aeffee4100e1bca Mon Sep 17 00:00:00 2001 From: Tim Jammer <tim.jammer@tu-darmstadt.de> Date: Fri, 13 Sep 2024 13:46:27 +0200 Subject: [PATCH] fix usage of absolute path --- MBB.py | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/MBB.py b/MBB.py index e6209d5d..30688e01 100755 --- a/MBB.py +++ b/MBB.py @@ -23,7 +23,7 @@ import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.patches as mpatches -from scripts.MBButils import categorize +from scripts.MBButils import categorize, parse_one_code mpl.rcParams['hatch.linewidth'] = 4.5 # hatch linewidth @@ -140,7 +140,7 @@ def extract_all_todo_from_logdir(tool, logdir): def cmd_gencodes(level): here = os.getcwd() - if os.path.exists("/MBB/scripts/errors/"): + if os.path.exists("./scripts/errors/"): #level = 2 print(f"Generate level {level}") subprocess.run(f'tar -xf real_world_data.csv.tar.gz', shell=True, check=True) @@ -150,39 +150,6 @@ def cmd_gencodes(level): os.chdir(here) - - # if os.path.exists("/MBI/scripts/original_MBI_generators/CollArgGenerator.py"): # Docker run - # print("Docker run") - # generators = glob.glob("/MBI/scripts/original_MBI_generators/*Generator.py") - # dir = "/MBI/gencodes" - # elif os.path.exists("../../scripts/original_MBI_generators/CollArgGenerator.py"): # Local run, from logs dir - # print("Local run, from tools' logs dir") - # generators = glob.glob(f"{os.getcwd()}/../../scripts/original_MBI_generators/*Generator.py") - # dir = "../../gencodes/" - # elif os.path.exists("scripts/original_MBI_generators/CollArgGenerator.py"): # Local run, from main dir - # print("Local run, from MBI main dir") - # generators = glob.glob(f"{os.getcwd()}/scripts/original_MBI_generators/*Generator.py") - # dir = "gencodes/" - # else: - # raise Exception("Cannot find the codes' original_MBI_generators. Please report that bug.") - # subprocess.run(f"rm -rf {dir} ; mkdir {dir}", shell=True, check=True) - # here = os.getcwd() - # os.chdir(dir) - # print(f"Generate the codes (in {os.getcwd()}): ", end='') - # for generator in generators: - # m = re.match("^.*?/([^/]*)Generator.py$", generator) - # if m: - # print(m.group(1), end=", ") - # else: - # print(generator, end=", ") - # subprocess.run(f'../scripts/ensure_python3 {generator}', shell=True, check=True) - # print("\nTest count: ", end='') - # sys.stdout.flush() - # subprocess.run("ls *.c|wc -l", shell=True, check=True) - # subprocess.run("for n in *.c ; do cat -n $n > $n.txt ; done", shell=True, check=True) - # os.chdir(here) - - ######################## # cmd_build(): what to do when '-c build' is used (building the tool, discarding the cache) ######################## -- GitLab