forked from Support/sp-hydra-veil-gui
Assets folder is part of startup
This commit is contained in:
parent
b536204048
commit
59cac90c58
5 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
from core.errors.logger import logger
|
from core.errors.logger import logger
|
||||||
from core.models.manage.session_management import init_session, get_session, close_session, create_ALL_tables, create_ONLY_db_version_table, get_path, does_it_exist, does_db_version_table_exist
|
from core.models.manage.session_management import init_session, get_session, close_session, create_ALL_tables, create_ONLY_db_version_table, get_path, does_it_exist, does_db_version_table_exist
|
||||||
from core.models.manage.version_check import check_database_compatibility, insert_new_version, get_custom_message
|
from core.models.manage.version_check import check_database_compatibility, insert_new_version, get_custom_message
|
||||||
|
from core.services.helpers.manage_assets import assets_folder_setup
|
||||||
from core.Constants import Constants
|
from core.Constants import Constants
|
||||||
# generic
|
# generic
|
||||||
import os
|
import os
|
||||||
|
|
@ -25,7 +26,7 @@ def recovery_dialog(custom_error, db_version_you_have):
|
||||||
|
|
||||||
elif choice == 2:
|
elif choice == 2:
|
||||||
logger.info(f"[DB MANAGEMENT] User opted to move the DB file.")
|
logger.info(f"[DB MANAGEMENT] User opted to move the DB file.")
|
||||||
from v2.ui.popups.pick_folder_to_move import launch_file_picker
|
from gui.v2.ui.popups.pick_folder_to_move import launch_file_picker
|
||||||
launch_file_picker(database_path)
|
launch_file_picker(database_path)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
@ -33,6 +34,14 @@ def recovery_dialog(custom_error, db_version_you_have):
|
||||||
logger.error(f"[DB MANAGEMENT] User opted to close the app WITHOUT wiping the database, even though they need to.")
|
logger.error(f"[DB MANAGEMENT] User opted to close the app WITHOUT wiping the database, even though they need to.")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# ASSETS FOLDER
|
||||||
|
# ============================================================================
|
||||||
|
if not assets_folder_setup():
|
||||||
|
from gui.v2.ui.popups.Database_version import show_recovery_dialog
|
||||||
|
custom_error = "Unable to Setup your Assets Folder."
|
||||||
|
recovery_dialog(custom_error, 0)
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# INITIALIZE DATABASE
|
# INITIALIZE DATABASE
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
@ -87,7 +96,7 @@ if is_compatable:
|
||||||
custom_error = "Critical Failure with starting the models of the database."
|
custom_error = "Critical Failure with starting the models of the database."
|
||||||
logger.error(f"[DB MANAGEMENT] {custom_error}")
|
logger.error(f"[DB MANAGEMENT] {custom_error}")
|
||||||
close_session()
|
close_session()
|
||||||
from v2.ui.popups.Database_version import show_recovery_dialog
|
from gui.v2.ui.popups.Database_version import show_recovery_dialog
|
||||||
choice = show_recovery_dialog({"message": custom_error, "db_version": 0, "status": "cant_make"})
|
choice = show_recovery_dialog({"message": custom_error, "db_version": 0, "status": "cant_make"})
|
||||||
logger.info(f"[DB MANAGEMENT] From the database error options, the user picked {choice}")
|
logger.info(f"[DB MANAGEMENT] From the database error options, the user picked {choice}")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue