Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code updated to support the latest version of PySimpleGUI #445

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aleapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
18 changes: 9 additions & 9 deletions aleappGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)] ]

Expand Down Expand Up @@ -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:
Expand All @@ -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):
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pillow
polyline==2.0.0
protobuf==3.10.0
PyCryptodome
PySimpleGUI==4.16.0
PySimpleGUI
pytz
simplekml
wheel
Expand Down