diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-02-22 23:06:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-22 23:06:27 -0500 |
| commit | bb42124a87393fa86288ad8f4079158183683f8f (patch) | |
| tree | efd8a5a216ffe41ba4b2c90b0ca8721dc953b7de /stub.py | |
| parent | 48e5d628a8f49b0ff7e6db3d91b3b91f4a1af91a (diff) | |
Windows fixes (#83)
* os.execv doesn't replace the process on windows
* fix simulate/params crash
* pyinstaller windowed mode breaks things?
* fix output routing for windows
* properly route stderr to inkscape too
* don't print unless there's something to print
* remove last backup version if necessary
* add documentation for Windows build
Diffstat (limited to 'stub.py')
| -rw-r--r-- | stub.py | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -2,6 +2,7 @@ import sys import os +import subprocess # ink/stitch # @@ -27,4 +28,17 @@ binary_path = os.path.join("inkstitch", "bin", binary_name) args = sys.argv[:] args[0] = binary_path -os.execv(binary_path, args) +# os.execve works here for Linux, but only this seems to get the +# extension output to Inkscape on Windows +extension = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +stdout, stderr = extension.communicate() + +stdout = stdout.strip() +if stdout: + print stdout.strip(), + +stderr = stderr.strip() +if stderr: + print >> sys.stderr, stderr.strip(), + +sys.exit(extension.returncode) |
