Skip to content

Commit

Permalink
Add human readable warning about missing gui config
Browse files Browse the repository at this point in the history
  • Loading branch information
Shtoyan committed Jul 4, 2023
1 parent 0ef8c3d commit 3e5b95a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ kfuz2_tkinter_gui/src/kfuz2

# MacOS
.DS_Store
kfuz2_tkinter_gui/src/tkinterGUI
5 changes: 5 additions & 0 deletions kfuz2_tkinter_gui/src/tkinterGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def save_state(self) -> None:

def load_state(self) -> bool:
my_pickle: Path = Path(os.path.realpath(__file__)).parent.joinpath(PICKLE_NAME)
if not my_pickle.exists():
print(
f"Config '{PICKLE_NAME}' was not found! Restart the app to generate it."
)
return False
try:
with open(my_pickle, "rb") as f:
(
Expand Down

0 comments on commit 3e5b95a

Please sign in to comment.