Skip to content

Commit

Permalink
Correct data environment setup to run before attempting to access it
Browse files Browse the repository at this point in the history
Correct champion role data to also check if the file is empty
Closes #3

Signed-off-by: Ethan Henderson <ethan@zbee.codes>
  • Loading branch information
zbee committed Nov 15, 2023
1 parent 24f4c4c commit a2b29e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions hinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion hinter/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 0 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a2b29e6

Please sign in to comment.