From ef138afac93470c107fb2f88b483fd73c511be55 Mon Sep 17 00:00:00 2001 From: Matthew Gaughan Date: Wed, 8 Nov 2023 13:17:01 -0600 Subject: [PATCH] fix to keyError --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index ceb8646..37077eb 100644 --- a/main.py +++ b/main.py @@ -55,7 +55,11 @@ def get_everything(manifest_path, early_cutoff): try: config = yaml.safe_load(stream) #below lines will probably need to be refactored as tasks expand - vcs_path = config['Upstream_VCS'] + try: + vcs_path = config['Upstream_VCS'] + except: + print('error with the keys, i guess') + return print("------------------") #print(vcs_path) return try: @@ -74,7 +78,7 @@ def get_everything(manifest_path, early_cutoff): largest_object[repo_path]['ghs_obj'] = ghs.main(vcs_path, early_cutoff) #print(ghs_obj["time_cleaned_comm"]) repo_uri_list = repo_path.split('/') - with open('/data/users/mgaughan/kkex_data_110823_2/' + repo_uri_list[-2] + '_' + repo_uri_list[-1] + '_result.json', 'w') as data_path: + with open('/data/users/mgaughan/kkex_data_110823_3/' + repo_uri_list[-2] + '_' + repo_uri_list[-1] + '_result.json', 'w') as data_path: json.dump(largest_object[repo_path], data_path) except yaml.YAMLError as err: @@ -112,4 +116,4 @@ largest_object[repo_path]['old_mmt'] = compute_old_mmt(largest_object[repo_path] #new mmt formality score largest_object[repo_path]['new_formality'] = compute_formality_score(largest_object[repo_path]['new_mmt'], largest_object[repo_path]["gha_obj"]['milestone_count'], largest_object[repo_path]["perceval_obj"]['age_of_project']) print(largest_object[repo_path]['new_formality']) -''' \ No newline at end of file +'''