Skip to content

Commit

Permalink
Made the 'save preset' button trim newline characters when saving pre…
Browse files Browse the repository at this point in the history
…sets
  • Loading branch information
lcgeneralprojects committed Oct 22, 2023
1 parent 77fea6b commit 4e98af4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def save_preset():
# TODO: consider the case where the name is empty
with open('./preset/' + param_dict['preset name'] + '.txt', 'w') as file:
for key, value in param_dict.items():
if not key == 'Preset name':
if not key == 'preset name':
file.write(key + ': ' + value + '\n')

save_preset_button = tk.Button(label_and_entry_frame, text='save preset', command=save_preset)
Expand All @@ -106,7 +106,7 @@ def choose_preset():
if line.strip() == '':
continue
key, value = line.split(': ', 1)
param_dict[key] = value
param_dict[key] = value.replace('\n', '')
for key, value in param_dict.items():
if value is not None:
ENTRY_OBJECT_DICT[key].delete(0, tk.END)
Expand Down

0 comments on commit 4e98af4

Please sign in to comment.