From 0b6443aa3697003d1ef6209c2db0157f69c89c7f Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Sun, 10 Mar 2024 17:03:51 +0100 Subject: [PATCH] fixed bug in combination with the program.json. --- main.py | 11 ++++++----- scripts/get_sys_info.py | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 61418b6..8c8ea83 100644 --- a/main.py +++ b/main.py @@ -5,8 +5,8 @@ import scripts.get_sys_info as system_code from scripts.ClosePopup import ClosePopup from scripts.settings import Settings -from scripts.converter import Converter -from scripts.labeling import Labeling +from scripts.Converter import Converter +from scripts.Labeling import Labeling from scripts.folder_mangement.OpenFolder import OpenFolder from scripts.folder_mangement.CreateFolder import CreateFolder @@ -257,6 +257,7 @@ class App(Ctk.CTk): relwidth=0.6, relheight=0.095 ) - -app = App() -app.mainloop() \ No newline at end of file +if __name__ == '__main__': + + app = App() + app.mainloop() \ No newline at end of file diff --git a/scripts/get_sys_info.py b/scripts/get_sys_info.py index d18f08b..b0579e5 100644 --- a/scripts/get_sys_info.py +++ b/scripts/get_sys_info.py @@ -42,21 +42,21 @@ def load_json_file(): } with open(json_file_path, 'w') as f: json.dump(data, f, indent=2) - else: - # Load the file - with open(json_file_path, 'r') as f: - data = json.load(f) - window_width = data["window_width"] - window_height = data["window_height"] - window_state = data["window_state"] - btn_img_size = data["btn_img_size"] - skipable_frames = data["skipable_frames"] - img_format = data["img_format"] - used_threads = data["used_threads"] - thread_detection_mode = data["thread_detection_method"] - data_mode = data["data_mode"] - color = data["color"] - thickness = data["thickness"] + + # Load the file + with open(json_file_path, 'r') as f: + data = json.load(f) + window_width = data["window_width"] + window_height = data["window_height"] + window_state = data["window_state"] + btn_img_size = data["btn_img_size"] + skipable_frames = data["skipable_frames"] + img_format = data["img_format"] + used_threads = data["used_threads"] + thread_detection_mode = data["thread_detection_method"] + data_mode = data["data_mode"] + color = data["color"] + thickness = data["thickness"] thread_options = set_thread_options() def calculate_automatic_threads():