Merge pull request #3973 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
PySimpleGUI 2021-02-27 13:17:14 -05:00 committed by GitHub
commit 91a79095ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 29 deletions

View File

@ -529,27 +529,6 @@ except:
if err: if err:
print(err.decode("utf-8")) print(err.decode("utf-8"))
try:
execute_editor = sg.execute_editor
except:
def execute_editor(file_to_edit, line_number=None):
editor_program = pysimplegui_user_settings.get('-editor program-', None)
if editor_program is not None:
format_string = pysimplegui_user_settings.get('-editor format string-', None)
# if no format string, then just launch the editor with the filename
if not format_string or line_number is None:
execute_command_subprocess(editor_program, file_to_edit)
else:
command = _create_full_editor_command(editor_program, file_to_edit, line_number, format_string)
print('final command line = ', command)
execute_command_subprocess(editor_program, command)
else:
print('No editor has been configured')
return
if __name__ == '__main__': if __name__ == '__main__':
# https://www.vecteezy.com/free-vector/idea-bulb is where I got the icon # https://www.vecteezy.com/free-vector/idea-bulb is where I got the icon

View File

@ -504,7 +504,7 @@ CUSTOM_TITLEBAR_FONT = None
TITLEBAR_METADATA_MARKER = 'This window has a titlebar' TITLEBAR_METADATA_MARKER = 'This window has a titlebar'
SUPPRESS_ERROR_POPUPS = False SUPPRESS_ERROR_POPUPS = False
SUPPRESS_RAISE_KEY_ERRORS = False SUPPRESS_RAISE_KEY_ERRORS = True
SUPPRESS_KEY_GUESSING = False SUPPRESS_KEY_GUESSING = False
ENABLE_TREEVIEW_869_PATCH = True ENABLE_TREEVIEW_869_PATCH = True
@ -8471,10 +8471,8 @@ class Window:
filename = error_parts[0][error_parts[0].index('File ')+5:] filename = error_parts[0][error_parts[0].index('File ')+5:]
line_num = error_parts[1][error_parts[1].index('line ')+5:] line_num = error_parts[1][error_parts[1].index('line ')+5:]
execute_editor(filename, line_num) execute_editor(filename, line_num)
print('Coming soon!', filename, line_num) if not SUPPRESS_RAISE_KEY_ERRORS:
# if not SUPPRESS_RAISE_KEY_ERRORS: raise KeyError(key)
# raise KeyError(key)
# else:
element = ErrorElement(key=key) element = ErrorElement(key=key)
key_error = True key_error = True
else: else:
@ -17706,11 +17704,10 @@ def execute_editor(file_to_edit, line_number=None):
execute_command_subprocess(editor_program, file_to_edit) execute_command_subprocess(editor_program, file_to_edit)
else: else:
command = _create_full_editor_command(editor_program, file_to_edit, line_number, format_string) command = _create_full_editor_command(editor_program, file_to_edit, line_number, format_string)
print('final command line = ', command) # print('final command line = ', command)
execute_command_subprocess(editor_program, command) execute_command_subprocess(editor_program, command)
else: else:
print('No editor has been configured') print('No editor has been configured in the global settings')
return return