update to data_gathering

This commit is contained in:
Matthew Gaughan 2024-03-12 06:02:33 -05:00
parent 1d678bb420
commit 6bdc4fa6ef

View File

@ -36,6 +36,7 @@ def file_get_pr(upstream_vcs_link, me_read):
merge_pre_rm, merge_post_rm, merge_pre_cont, merge_post_cont = 0, 0, 0, 0 merge_pre_rm, merge_post_rm, merge_pre_cont, merge_post_cont = 0, 0, 0, 0
#list of tuples which has date and whether it was a merge #list of tuples which has date and whether it was a merge
commit_list = [] commit_list = []
first_date_readme = ""
for commit in commits: for commit in commits:
if "Merge" in commit['data'].keys(): if "Merge" in commit['data'].keys():
commit_list.append([commit['data']['CommitDate'], True]) commit_list.append([commit['data']['CommitDate'], True])
@ -56,6 +57,8 @@ def file_get_pr(upstream_vcs_link, me_read):
has_readme = True has_readme = True
first_date_readme = dateutil.parser.parse(commit['data']['CommitDate']) first_date_readme = dateutil.parser.parse(commit['data']['CommitDate'])
shutil.rmtree(full_temp_path, ignore_errors=True) shutil.rmtree(full_temp_path, ignore_errors=True)
if first_date_readme == "":
return {}
if me_read: if me_read:
project_dict['first_readme'] = first_date_readme project_dict['first_readme'] = first_date_readme
before_read = pr_count(first_date_readme+ dt.timedelta(days=-window, hours=0), first_date_readme, commit_list) before_read = pr_count(first_date_readme+ dt.timedelta(days=-window, hours=0), first_date_readme, commit_list)