-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup.py
More file actions
39 lines (29 loc) · 1.32 KB
/
cleanup.py
File metadata and controls
39 lines (29 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# WARNING: this scripts will delete all credentials, and results found in the VCF_annotator directory. BACKUP EVERYTHING YOU NEED.
from os import listdir, remove, path
print("Hold Your Horses: all credentials, and results found in the VCF_annotator directory will be deleted")
confirm = input("Are you sure you want to remove login info and results? [y/n]: ")
json_file_cred = "./scripts/settings/credentials.json"
if confirm=="y" or confirm=="Y":
print("Removing files....")
results_to_rm = listdir("./results/MAFTools/")
for res in results_to_rm:
remove(path.join("./results/MAFTools",res))
print(" -->",f"./results/MAFTools/{res}" , "removed.")
#removes results in result directory
results_to_rm = listdir("./results/")
for res in results_to_rm:
if path.isdir(path.join("./results/",res)) == True:
pass
else:
remove(path.join("./results/",res))
print(" -->",f"./results/{res}" , "removed.")
#Removes JSON credentials.
if path.exists(json_file_cred) == True:
remove(json_file_cred)
print("Credentials were removed.")
else:
print("Credentials were not saved, step skipped.")
print("Done! Good-bye :)")
else:
print("aborting...")
print("Your files are safe.")