kopia lustrzana https://github.com/inkstitch/inkstitch
Refactor electron to always pipe stdout to /dev/null
rodzic
2c6adea150
commit
a3b7d8eb42
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue