From a2b29e6b3507278e0407edab45e20151de326f95 Mon Sep 17 00:00:00 2001 From: Ethan Henderson Date: Wed, 15 Nov 2023 07:50:33 -0700 Subject: [PATCH] Correct data environment setup to run before attempting to access it Correct champion role data to also check if the file is empty Closes #3 Signed-off-by: Ethan Henderson --- hinter/__init__.py | 6 ++++++ hinter/settings.py | 2 +- main.py | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hinter/__init__.py b/hinter/__init__.py index 9489a69..ae62b91 100644 --- a/hinter/__init__.py +++ b/hinter/__init__.py @@ -48,6 +48,9 @@ Menu: UIMenus = hinter.UIMenus() Errors: Errors = hinter.Errors() +# Make sure all files and folders exist +hinter.data.management.Setup() + # Set up settings settings = hinter.settings.Settings() settings.load_settings() @@ -58,6 +61,9 @@ hinter.data.constants.PATH_CHAMPION_ROLE_DATA_FILE, 2 ) +# Check if the file is empty +if hinter.data.management.file_empty(hinter.data.constants.PATH_CHAMPION_ROLE_DATA_FILE): + want_new_champion_role_data = True # If we do need to get fresh data if want_new_champion_role_data: diff --git a/hinter/settings.py b/hinter/settings.py index 3a40080..ddd1f00 100644 --- a/hinter/settings.py +++ b/hinter/settings.py @@ -79,7 +79,7 @@ class Settings: pipeline_defaulted: bool = False - pipeline: str = _pipeline_fast + pipeline: str = _pipeline_private # TODO: set to _fast once kernel is online telemetry: bool = False def load_settings(self, refresh: bool = False): diff --git a/main.py b/main.py index c24ebc5..84f0e01 100644 --- a/main.py +++ b/main.py @@ -18,9 +18,6 @@ # noinspection PyPep8Naming import hinter.match_history.history_data as History -# Make sure all files and folders exist -hinter.data.management.Setup() - def continue_drawing(): History.HistoryData()