From f98364b8147b8d8ec8e2550f71a79a48e0a7f091 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 29 Feb 2020 14:28:15 -0800 Subject: [PATCH] Fix handling of lnks that have commandline arguments. --- PGUI.pyw | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PGUI.pyw b/PGUI.pyw index 38d9a9a..d6e0809 100644 --- a/PGUI.pyw +++ b/PGUI.pyw @@ -14,15 +14,16 @@ def load_programs(): for shortcut in shortcuts: name = os.path.splitext(os.path.basename(shortcut))[0] shortcut = winshell.Shortcut(shortcut) - program = Program(name, f'{shortcut.path} {shortcut.arguments}') + program = Program(name, shortcut.path, shortcut.arguments) programs.append(program) return programs class Program(): - def __init__(self, name, path): + def __init__(self, name, path, arguments): self.name = name self.path = os.path.abspath(path) + self.arguments = arguments def __str__(self): return f'{self.name}: {self.path}' @@ -38,7 +39,8 @@ class PGUILauncher(Frame): def launch_program(self, program): print('opening application', program.name) os.chdir(os.path.dirname(program.path)) - subprocess.Popen(program.path, shell=True) + command = f'{program.path} {program.arguments}' + subprocess.Popen(command, shell=True) self.quit() def init_ui(self):