summary refs log tree commit diff stats
path: root/github/output.py
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-16 14:52:28 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-16 14:52:28 +0200
commit2843bb65aeaeb86eb89bf3d9690db61b9dc6306e (patch)
treeb88d8e4dd702322cd0f27dd3d312b0e99dfdf509 /github/output.py
parent35f097a31e1c58892a69178b84ddba658efe9c8f (diff)
downloadqemu-analysis-2843bb65aeaeb86eb89bf3d9690db61b9dc6306e.tar.gz
qemu-analysis-2843bb65aeaeb86eb89bf3d9690db61b9dc6306e.zip
add a github scraper
Diffstat (limited to 'github/output.py')
-rwxr-xr-xgithub/output.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/github/output.py b/github/output.py
new file mode 100755
index 000000000..6d64d71d1
--- /dev/null
+++ b/github/output.py
@@ -0,0 +1,16 @@
+from os import path, makedirs
+
+def write_file(file_path : str, string : str) -> None:
+    makedirs(path.dirname(file_path), exist_ok = True)
+    with open(file_path, "w") as file:
+        file.write(string)
+
+def output_issue(issue : dict) -> None:
+    try:
+        if 'documentation' in issue['labels']:
+            write_file(f"issues/documentation/{issue['id']}", issue['title'] + '\n' + (issue['description'] or ""))
+        else:
+            write_file(f"issues/{issue['id']}", issue['title'] + '\n' + (issue['description'] or ""))
+    except TypeError:
+        print(f"error with bug {issue['id']}")
+        exit()