Merge pull request #4779 from PySimpleGUI/Dev-latest

Simplified support to be for local files only
This commit is contained in:
PySimpleGUI 2021-10-03 13:14:10 -04:00 committed by GitHub
commit 6d61943a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 17 deletions

View File

@ -31,12 +31,6 @@ def create_shortcut(path, target='', icon=''):
""" """
filename, ext = os.path.splitext(path) filename, ext = os.path.splitext(path)
working_dir = os.path.dirname(filename) working_dir = os.path.dirname(filename)
if ext == 'url':
shortcut = file(filename, 'w')
shortcut.write('[InternetShortcut]\n')
shortcut.write('URL=%s' % target)
shortcut.close()
else:
shell = Dispatch('WScript.Shell') shell = Dispatch('WScript.Shell')
shortcut_filename = filename + ".lnk" shortcut_filename = filename + ".lnk"
shortcut = shell.CreateShortCut(f'{shortcut_filename}') shortcut = shell.CreateShortCut(f'{shortcut_filename}')