kopia lustrzana https://github.com/inkstitch/inkstitch
Merge pull request #260 from inkstitch/lexelby-windows-output-fix
fix output extension on windowspull/281/head
commit
fe480750c5
|
@ -36,10 +36,15 @@ class Output(InkstitchExtension):
|
||||||
|
|
||||||
write_embroidery_file(temp_file.name, stitch_plan, self.document.getroot())
|
write_embroidery_file(temp_file.name, stitch_plan, self.document.getroot())
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
import msvcrt
|
||||||
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
||||||
|
|
||||||
# inkscape will read the file contents from stdout and copy
|
# inkscape will read the file contents from stdout and copy
|
||||||
# to the destination file that the user chose
|
# to the destination file that the user chose
|
||||||
with open(temp_file.name) as output_file:
|
with open(temp_file.name, "rb") as output_file:
|
||||||
sys.stdout.write(output_file.read())
|
sys.stdout.write(output_file.read())
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
# clean up the temp file
|
# clean up the temp file
|
||||||
os.remove(temp_file.name)
|
os.remove(temp_file.name)
|
||||||
|
|
4
stub.py
4
stub.py
|
@ -43,6 +43,10 @@ except:
|
||||||
print >> sys.stderr, traceback.format_exc()
|
print >> sys.stderr, traceback.format_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
import msvcrt
|
||||||
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
||||||
|
|
||||||
stdout = stdout.strip()
|
stdout = stdout.strip()
|
||||||
if stdout:
|
if stdout:
|
||||||
print stdout.strip(),
|
print stdout.strip(),
|
||||||
|
|
Ładowanie…
Reference in New Issue