Refactor electron to always pipe stdout to /dev/null

pull/432/head
katee 2019-04-22 21:42:17 -04:00
rodzic 2c6adea150
commit a3b7d8eb42
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: D11DBB4D6314A798
1 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -11,19 +11,22 @@ app_process = None
def open_url(url):
global app
# Any output on stdout will crash inkscape.
null = open(os.devnull, 'w')
command = []
cwd = None
if getattr(sys, 'frozen', None) is not None:
electron_path = os.path.join(get_bundled_dir("electron"), "inkstitch-gui")
if sys.platform == "darwin":
electron_path += ".app/Contents/MacOS/inkstitch-gui"
subprocess.Popen(["open", "-a", electron_path, "--args", url], stdout=null)
command = ["open", "-a", electron_path, "--args", url]
else:
app_process = subprocess.Popen([electron_path, url])
command = [electron_path, url]
else:
# if we're not running in a pyinstaller bundle, run electron directly
app_process = subprocess.Popen(["yarn", "dev", url], cwd=get_bundled_dir("electron"), stdout=null)
command = ["yarn", "dev", url]
cwd = get_bundled_dir("electron")
return app_process
# Any output on stdout will crash inkscape.
null = open(os.devnull, 'w')
return subprocess.Popen(command, cwd=cwd, stdout=null)