forked from DonTizi/ReMind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.py
29 lines (24 loc) · 1 KB
/
reset.py
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
# Author: Elyes Rayane Melbouci
# Purpose: This script resets the data by deleting the specified directory and all its contents.
import os
import shutil
from pathlib import Path
from tqdm import tqdm
def reset_data(progress_bar):
"""Reset the data by deleting the specified directory and all its contents."""
progress_bar.set_description("Resetting data")
# Path to the directory to be deleted
data_dir = Path.home() / 'Library' / 'Application Support' / 'RemindEnchanted'
# Check if the directory exists
if data_dir.exists() and data_dir.is_dir():
# Delete the directory and all its contents
shutil.rmtree(data_dir)
progress_bar.update(1)
print(f"All data in {data_dir} has been reset.")
else:
progress_bar.update(1)
print(f"No data found at {data_dir}.")
if __name__ == "__main__":
total_steps = 1 # Resetting data (1 step)
with tqdm(total=total_steps, desc="Starting reset") as progress_bar:
reset_data(progress_bar)