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
This commit is contained in:
Karma Riuk
2025-02-28 14:05:41 +01:00
parent 2eea1ab551
commit b4d7c5f070

View File

@ -164,7 +164,16 @@ def clone_repos(file: str, dest: str, force: bool =False, verbose: bool = False)
return return
# if verbose: print(f"Keeping {repo}") # 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") if verbose: print("Writing CSV file")
df.to_csv("results.csv.gz", index=False) df.to_csv("results.csv.gz", index=False)