From b4d7c5f07035ef24904a29abbb06a945616a23d9 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Fri, 28 Feb 2025 14:05:41 +0100 Subject: [PATCH] added handling of keyboard interrupt to save the results even if we press C-c, this allows to not have to wait until all the repos are done processing to see the results --- clone_repos.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clone_repos.py b/clone_repos.py index 280ed8b..ec26061 100644 --- a/clone_repos.py +++ b/clone_repos.py @@ -164,7 +164,16 @@ def clone_repos(file: str, dest: str, force: bool =False, verbose: bool = False) return # if verbose: print(f"Keeping {repo}") - df.progress_apply(_process, axis=1) + # Check for compilation and tests + + # If repo was not removed, then it is a good repo + row["good_repo_for_crab"] = True + + + try: + df.progress_apply(_process, axis=1) + except KeyboardInterrupt: + print("Keyboard interrupt detected. Stopping the processing of the repos...") if verbose: print("Writing CSV file") df.to_csv("results.csv.gz", index=False)