From d113e0991a3ebca2f010344f8fb92fd4d3f1805b Mon Sep 17 00:00:00 2001 From: Matthew Gaughan Date: Sun, 31 Mar 2024 16:50:23 -0500 Subject: [PATCH] updating specific file etc. --- get_spec_file.py | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/get_spec_file.py b/get_spec_file.py index 6a889bc..f450538 100644 --- a/get_spec_file.py +++ b/get_spec_file.py @@ -66,33 +66,7 @@ def get_file(vcs_link, commit_hash, is_readme): shutil.rmtree(full_temp_path, ignore_errors=True) shutil.rmtree(other_temp_path, ignore_errors=True) return "NoFile" - #target_filename = r"/README/" - #issue with searching through the tree this way - # need to match the tree w blobs - #print(commit0.tree.blobs) - #file_id = commit0.tree[r'README.*'].hexsha - #targetfile = repo0.blob(file_id) - #targetfile = commit0.tree / target_filename - ''' - try: - targetfile = commit0.tree / target_filename - except KeyError: - target_filename = "README.rst" - try: - targetfile = commit0.tree / target_filename - except KeyError: - target_filename = "README" - try: - targetfile = commit0.tree / target_filename - except KeyError: - target_filename = "README.txt" - try: - targetfile = commit0.tree / target_filename - except KeyError: - shutil.rmtree(full_temp_path, ignore_errors=True) - shutil.rmtree(other_temp_path, ignore_errors=True) - return "KeyError -- the file is not in the commit tree" - ''' + targetfile = "" for blob in commit0.tree.blobs: #print(type(blob.path)) @@ -140,9 +114,9 @@ def for_all_files(): return_value = get_file(row[0], row[2], readme_is) if return_value != "NoError": csv_writer.writerow([row[0], row[2], readme_is, return_value]) - #get_file('https://github.com/tqdm/tqdm', 'fbe7952cce11e8073378b063bdae7ab277a96eb8', True) + # if it is noError, just write the row down in a different csv + # there's an issue of duplicates, but just keep it moving + # if no duplicates -- just run it through if __name__ == "__main__": - for_all_files() - #print(get_file('https://github.com/the-tcpdump-group/tcpslice', 'ffac277bf41946a1d985afae7fe2535d7a28546f', True)) - #get_file('https://github.com/krahets/hello-algo/tree/dev1', 'f615ad42ef3c58cfc6f080b8fb0cd0eb741706a9', True ) \ No newline at end of file + for_all_files() \ No newline at end of file