diff --git a/file_manager/drive_connector.py b/file_manager/drive_connector.py index cca3835..d98e326 100644 --- a/file_manager/drive_connector.py +++ b/file_manager/drive_connector.py @@ -39,5 +39,5 @@ def connect_to_drive(access_file): if __name__ == "__main__": - DRIVE = connect_to_drive("./app_data/raspi.json") + DRIVE = connect_to_drive("../app_data/raspi.json") print(DRIVE) diff --git a/file_manager/drive_local_file_manager.py b/file_manager/drive_local_file_manager.py index 06e8f9c..31c413a 100644 --- a/file_manager/drive_local_file_manager.py +++ b/file_manager/drive_local_file_manager.py @@ -14,14 +14,16 @@ current_file_directory = os.path.dirname(os.path.realpath(__file__)) +project_dir = os.path.dirname(current_file_directory) + # Load the configuration from the config.json file -with open(f"{current_file_directory}/app_config.json", encoding="utf-8") as config_file: +with open(f"{project_dir}/app_config.json", encoding="utf-8") as config_file: config = json.load(config_file) # Constants TARGET_DIR = config["TARGET_DIR"] -CURRENT_FILES_FILE = f"{current_file_directory}/app_data/current_files.json" -CHANGES_STATE_FILE = f"{current_file_directory}/app_data/changes_state.json" +CURRENT_FILES_FILE = f"{project_dir}/app_data/current_files.json" +CHANGES_STATE_FILE = f"{project_dir}/app_data/changes_state.json" USE_GDRIVE = config["USE_GDRIVE"] GOOGLE_API_ACCESS = config["GOOGLE_API_ACCESS"] DRIVE_DIR_ID = config["DRIVE_DIR_ID"] diff --git a/file_manager/show_file_checker.py b/file_manager/show_file_checker.py index 812f6ac..7977354 100644 --- a/file_manager/show_file_checker.py +++ b/file_manager/show_file_checker.py @@ -9,7 +9,7 @@ from datetime import datetime from pathlib import Path -#pylint: disable=wrong-import-position +# pylint: disable=wrong-import-position PARENT_DIRECTORY_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(PARENT_DIRECTORY_PATH) from MetaDataEditor.image_metadata_handler import read_metadata @@ -99,5 +99,5 @@ def check_for_event(file): if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) - TEST = check_for_event("./app_data/content/xx01.01.24@02.03.25.png") + TEST = check_for_event("../app_data/content/xx01.01.24@02.03.25.png") print(f"{TEST}")