Skip to content

Commit

Permalink
Code updated to support the latest version of PySimpleGUI
Browse files Browse the repository at this point in the history
Johann-PLW committed Jan 4, 2024
1 parent d14b83a commit ac71ec0
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions aleapp.py
Original file line number Diff line number Diff line change
@@ -227,8 +227,8 @@ def main():
with open(case_data_filename, "rt", encoding="utf-8") as case_data_file:
try:
case_data = json.load(case_data_file)
except json.JSONDecodeError as json_ex:
case_data_load_error = f"File was not a valid case data file: {json_ex}"
except:
case_data_load_error = "File was not a valid case data file: invalid format"
print(case_data_load_error)
return

@@ -252,8 +252,8 @@ def main():
with open(profile_filename, "rt", encoding="utf-8") as profile_file:
try:
profile = json.load(profile_file)
except json.JSONDecodeError as json_ex:
profile_load_error = f"File was not a valid profile file: {json_ex}"
except:
profile_load_error = "File was not a valid case data file: invalid format"
print(profile_load_error)
return

18 changes: 9 additions & 9 deletions aleappGUI.py
Original file line number Diff line number Diff line change
@@ -70,8 +70,8 @@ def add_case_data(casedata):
with open(destination_path, "rt", encoding="utf-8") as case_data_in:
try:
case_data = json.load(case_data_in)
except json.JSONDecodeError as json_ex:
case_data_load_error = f"File was not a valid case data file: {json_ex}"
except:
case_data_load_error = "File was not a valid case data file: invalid format"

if not case_data_load_error:
if isinstance(case_data, dict):
@@ -82,7 +82,7 @@ def add_case_data(casedata):
for key, value in casedata.items():
case_data_window[key].update(value)
else:
case_data_load_error = "File was not a valid case data file: invalid format"
case_data_load_error = "File was not a valid case data file: invalid format"

if case_data_load_error:
sg.popup(case_data_load_error)
@@ -123,7 +123,7 @@ def ValidateInput(values, window):

one_element_is_selected = False
for x in range(1000, module_end_index):
if window.FindElement(x).Get():
if window[x].Get():
one_element_is_selected = True
break
if not one_element_is_selected:
@@ -196,7 +196,7 @@ def pickModules():
sg.Text('Timezone Offset (Not Implemented Yet):', font=("Helvetica", 14)),
sg.Combo(list(tzvalues), size=(20,15), key='timezone',readonly=True)
],
[sg.Column(mlist, size=(300,310), scrollable=True), sg.Output(size=(85,20))],
[sg.Column(mlist, size=(300,310), scrollable=True), sg.Output(size=(85,29))],
[sg.ProgressBar(max_value=GuiWindow.progress_bar_total, orientation='h', size=(86, 7), key='PROGRESSBAR', bar_color=('DarkGreen', 'White'))],
[sg.Submit('Process', font=normal_font), sg.Button('Close', font=normal_font)] ]

@@ -231,7 +231,7 @@ def pickModules():
if destination_path:
ticked = []
for x in range(MODULE_START_INDEX, module_end_index):
if window.FindElement(x).Get():
if window[x].Get():
key = window[x].metadata
ticked.append(key)
with open(destination_path, "wt", encoding="utf-8") as profile_out:
@@ -249,8 +249,8 @@ def pickModules():
with open(destination_path, "rt", encoding="utf-8") as profile_in:
try:
profile = json.load(profile_in)
except json.JSONDecodeError as json_ex:
profile_load_error = f"File was not a valid profile file: {json_ex}"
except:
profile_load_error = "File was not a valid profile file: invalid format"

if not profile_load_error:
if isinstance(profile, dict):
@@ -296,7 +296,7 @@ def pickModules():

s_items = 0
for x in range(MODULE_START_INDEX, module_end_index):
if window.FindElement(x).Get():
if window[x].Get():
key = window[x].metadata
if key in loader and key != 'usagestatsVersion':
search_list.append(loader[key])
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ pillow
polyline==2.0.0
protobuf==3.10.0
PyCryptodome
PySimpleGUI==4.16.0
PySimpleGUI
pytz
simplekml
wheel

0 comments on commit ac71ec0

Please sign in to comment.