From 011068f6c750a8c1257dc421638619510486d8f8 Mon Sep 17 00:00:00 2001 From: Ainoras Zukauskas Date: Sat, 5 Dec 2020 17:14:20 +0100 Subject: [PATCH] Added bugzilla link reconstruction --- src/reconstruct_links.py | 10 ++++++++++ src/utils.py | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/reconstruct_links.py diff --git a/src/reconstruct_links.py b/src/reconstruct_links.py new file mode 100644 index 0000000..f233b3e --- /dev/null +++ b/src/reconstruct_links.py @@ -0,0 +1,10 @@ +import glob +from utils import extract_filename + +files = glob.glob("ignored_data/with_exceptions/*.xml") +for file in files: + name = extract_filename(file) + prefix, idx = name.split("_") + idx = int(idx) + + print(f"https://bugs.eclipse.org/bugs/show_bug.cgi?id={idx}") diff --git a/src/utils.py b/src/utils.py index e3aca1a..a2c90f0 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1,4 +1,8 @@ import numpy as np +from pathlib import Path def chunks(l, n): - return [list(array) for array in np.array_split(l, n)] \ No newline at end of file + return [list(array) for array in np.array_split(l, n)] + +def extract_filename(path): + return Path(path).stem \ No newline at end of file