From ba183137931bab7d656ff967ec88983c57d8e05f Mon Sep 17 00:00:00 2001 From: Sermet Pekin <96650846+SermetPekin@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:37:36 +0300 Subject: [PATCH] Update setup_folders.py --- .../EVDSlocal/initial_setup/setup_folders.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/evdspy/EVDSlocal/initial_setup/setup_folders.py b/evdspy/EVDSlocal/initial_setup/setup_folders.py index 7dc2615..9ddeb2d 100644 --- a/evdspy/EVDSlocal/initial_setup/setup_folders.py +++ b/evdspy/EVDSlocal/initial_setup/setup_folders.py @@ -4,22 +4,34 @@ from evdspy.EVDSlocal.initial.start_options import * from ..common.colors import * from evdspy.EVDSlocal.initial.start_options import default_data_folder_name -dirs = ("pickles", default_data_folder_name) +# dirs = ("pickles", default_data_folder_name) +dirs = ( default_data_folder_name , ) cur_folder = Path() import time + +def get_cache_folder(): + pickle_folder = Path.home() / ".cache" / "evdspy" + return pickle_folder +def create_cache_folder(): + pickle_folder =get_cache_folder() + create_directory(str(pickle_folder)) def check_folders_setup_necessary(): for item in dirs: folder_ = cur_folder.absolute() / item if not folder_.is_dir(): return True - return False + pickle_folder =get_cache_folder() + + return pickle_folder.is_dir() def check_setup(): return not check_folders_setup_necessary() def setup_folders(): + if not check_folders_setup_necessary(): return + create_cache_folder() for item in dirs: folder_ = cur_folder.absolute() / item print_with_creating_style(f"Creating directory...{folder_}") create_directory(str(folder_)) - time.sleep(0.8) \ No newline at end of file + time.sleep(0.8)