diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-07-16 14:52:28 +0200 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-07-16 14:52:28 +0200 |
| commit | 2843bb65aeaeb86eb89bf3d9690db61b9dc6306e (patch) | |
| tree | b88d8e4dd702322cd0f27dd3d312b0e99dfdf509 /github/output.py | |
| parent | 35f097a31e1c58892a69178b84ddba658efe9c8f (diff) | |
| download | emulator-bug-study-2843bb65aeaeb86eb89bf3d9690db61b9dc6306e.tar.gz emulator-bug-study-2843bb65aeaeb86eb89bf3d9690db61b9dc6306e.zip | |
add a github scraper
Diffstat (limited to '')
| -rwxr-xr-x | github/output.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/github/output.py b/github/output.py new file mode 100755 index 00000000..6d64d71d --- /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() |