* 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
pull/68/head
Lex Neva 2018-02-22 23:06:27 -05:00 zatwierdzone przez GitHub
rodzic 48e5d628a8
commit bb42124a87
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
6 zmienionych plików z 44 dodań i 12 usunięć

Wyświetl plik

@ -1,10 +1,11 @@
# ink/stitch: An Inkscape extension for designing machine embroidery patterns
* February 22, 2018: **Windows support added!**
* February 5, 2018: Portuguese (pt_PT) translation added! [Want to help translate?](LOCALIZATION.md)
* January 5, 2018: Default DPI changed to 96, to match Inkscape.
* January 3, 2018: Project renamed from `inkscape-embroidery` to **ink/stitch**
* **NEW January 1, 2018:** [video demo of the new live stitch preview feature](https://youtu.be/QY9NcLN3oJM)
* **NEW December 6, 2017:** [video demo of how to use the extension](https://www.youtube.com/watch?v=qXntE1X1RIw)
* January 1, 2018: [video demo of the new live stitch preview feature](https://youtu.be/QY9NcLN3oJM)
* December 6, 2017: [video demo of how to use the extension](https://www.youtube.com/watch?v=qXntE1X1RIw)
## Introduction
**Want to design embroidery pattern files (PES, DST, etc) using free, open source software? Hate all the other options? Try this one.**
@ -15,9 +16,19 @@ So I wrote one.
Okay, not really. I'm pretty terrible at GUIs, but I found this nifty inkscape extension that was created and hacked on by a couple of other folks. It was pretty rudimentary, but it got the job done, and more importantly, it was super hackable. I hacked the hell out of it, and at this point **ink/stitch is a viable entry-level machine embroidery design tool**.
## Quick Setup On Ubuntu 14.04 or later (and derivative Linux distributions)
## Quick Setup On Ubuntu and Windows
Download the [latest release](https://github.com/lexelby/inkstitch/releases/latest), the `inkscape-*.tar.gz` file. Decompress this archive directly into `~/.config/inkscape/extensions`, for example:
First, download the right release archive for your platform from the [latest release](https://github.com/lexelby/inkstitch/releases/latest).
* **Linux**: `inkstitch-[VERSION]-Linux-x86_64.tar.gz`
* Currently supports most 64-bit Linux systems from the last couple of years.
* 32-bit support coming soon.
* **Windows**: `inkstitch-[VERSION]-win32.zip`
* Supports 32-bit and 64-bit Windows
In Inkscape, go to Preferences and look under System. Next to "User Extensions" is a folder. Decompress the archive you downloaded directly into this folder.
For example, on Linux:
```
$ cd ~/.config/inkscape/extensions

Wyświetl plik

@ -32,7 +32,7 @@ pyinstaller_args+="-p inkscape-0.92.2/share/extensions "
mkdir -p dist/inkstitch/bin
for extension in "$@"; do
if [ "$BUILD" = "windows" ]; then
wine c:\\Python\\scripts\\pyinstaller.exe --windowed $pyinstaller_args ${extension}.py
wine c:\\Python\\scripts\\pyinstaller.exe $pyinstaller_args ${extension}.py
else
# without the LD_LIBRARY_PATH, it seems that pyinstaller can't find all of
# wxpython's shared libraries

Wyświetl plik

@ -1718,6 +1718,10 @@ class Embroider(inkex.Effect):
if os.path.exists(source):
move_if_exists(path, suffix + 1)
if os.path.exists(dest):
os.remove(dest)
os.rename(source, dest)
move_if_exists(output_path)

Wyświetl plik

@ -233,6 +233,9 @@ class EmbroiderySimulator(wx.Frame):
if self.on_close_hook:
self.on_close_hook()
# If we keep a reference here, wx crashes when the process exits.
self.canvas = None
self.Destroy()
def stop(self):

Wyświetl plik

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-19 20:13-0500\n"
"POT-Creation-Date: 2018-02-21 21:46-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -183,20 +183,20 @@ msgid ""
"Seeing a 'no such option' message? Please restart Inkscape to fix."
msgstr ""
#: embroider.py:1743
#: embroider.py:1747
msgid "No embroiderable paths selected."
msgstr ""
#: embroider.py:1745
#: embroider.py:1749
msgid "No embroiderable paths found in document."
msgstr ""
#: embroider.py:1746
#: embroider.py:1750
msgid ""
"Tip: use Path -> Object to Path to convert non-paths before embroidering."
msgstr ""
#: embroider.py:1758
#: embroider.py:1762
msgid "Embroidery"
msgstr ""
@ -296,7 +296,7 @@ msgid ""
"Preset \"%s\" already exists. Please use another name or press \"Overwrite\""
msgstr ""
#: embroider_simulate.py:303
#: embroider_simulate.py:306
msgid "Embroidery Simulation"
msgstr ""

16
stub.py
Wyświetl plik

@ -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)