From 60bae2df181e3017b939e17f955d93ff460da9ac Mon Sep 17 00:00:00 2001 From: paulgr98 Date: Fri, 13 Jan 2023 19:52:54 +0100 Subject: [PATCH] Added app exit on error --- app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.py b/app.py index f787562..0081c00 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ import PySimpleGUI as sg import tomllib as tml import json +import sys icon = './heart.ico' @@ -9,6 +10,7 @@ config = tml.load(f) except FileNotFoundError: sg.popup('File "config.toml" not found...', title='Opps!', button_type=sg.POPUP_BUTTONS_OK) + sys.exit() lang = config['app']['lang'] @@ -17,6 +19,7 @@ msg = json.load(f) except FileNotFoundError: sg.popup('File "msg.json" not found...', title='Opps!', button_type=sg.POPUP_BUTTONS_OK) + sys.exit() # check if the language is supported in msg.json if lang not in msg: