kopia lustrzana https://github.com/inkstitch/inkstitch
integrate inx generation into ink/stitch proper
rodzic
a4d588e392
commit
512c341164
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys, os
|
||||
from os.path import dirname
|
||||
import pyembroidery
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
|
||||
|
||||
def build_environment():
|
||||
template_dir = os.path.join(dirname(dirname(os.path.realpath(__file__))), "templates")
|
||||
|
||||
return Environment(
|
||||
loader = FileSystemLoader(template_dir),
|
||||
autoescape = True
|
||||
)
|
||||
|
||||
|
||||
def pyembroidery_input_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'reader' in format and format['category'] == 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def main():
|
||||
env = build_environment()
|
||||
template = env.get_template('embroider_input.inx')
|
||||
|
||||
for format, description in pyembroidery_input_formats():
|
||||
inx = template.render(format=format, description=description)
|
||||
|
||||
with open("inx/inkstitch_input_%s.inx" % format.upper(), 'w') as inx_file:
|
||||
print >> inx_file, inx
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import pyembroidery
|
||||
|
||||
formats = [format for format in pyembroidery.supported_formats() if 'writer' in format]
|
||||
formats.sort(key=lambda format: (format['category'] != 'embroidery', format['extension']))
|
||||
|
||||
for format in formats:
|
||||
tag = ""
|
||||
if format['category'] != 'embroidery':
|
||||
tag = " [DEBUG]"
|
||||
|
||||
print '<_option value="%s">%s(%s)%s</_option>' % (format['extension'], format['description'], format['extension'].upper(), tag)
|
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys, os
|
||||
from os.path import dirname
|
||||
import pyembroidery
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
|
||||
|
||||
def build_environment():
|
||||
template_dir = os.path.join(dirname(dirname(os.path.realpath(__file__))), "templates")
|
||||
|
||||
return Environment(
|
||||
loader = FileSystemLoader(template_dir),
|
||||
autoescape = True
|
||||
)
|
||||
|
||||
|
||||
def pyembroidery_output_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'writer' in format and format['category'] == 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def main():
|
||||
env = build_environment()
|
||||
template = env.get_template('embroider_output.inx')
|
||||
|
||||
for format, description in pyembroidery_output_formats():
|
||||
inx = template.render(format=format, description=description)
|
||||
|
||||
with open("inx/inkstitch_output_%s.inx" % format.upper(), 'w') as inx_file:
|
||||
print >> inx_file, inx
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -1,35 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys, os
|
||||
from os.path import dirname
|
||||
import pyembroidery
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
|
||||
|
||||
def build_environment():
|
||||
template_dir = os.path.join(dirname(dirname(os.path.realpath(__file__))), "templates")
|
||||
|
||||
return Environment(
|
||||
loader = FileSystemLoader(template_dir),
|
||||
autoescape = True
|
||||
)
|
||||
|
||||
|
||||
def pyembroidery_output_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'writer' in format and format['category'] == 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def main():
|
||||
env = build_environment()
|
||||
template = env.get_template('embroider_zip_output.inx')
|
||||
|
||||
inx = template.render(formats=pyembroidery_output_formats())
|
||||
|
||||
with open("inx/inkstitch_output_ZIP.inx", 'w') as inx_file:
|
||||
inx_file.write(inx)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
from os.path import dirname
|
||||
|
||||
sys.path.append(os.path.join(dirname(dirname(__file__))))
|
||||
from lib.inx import generate_inx_files
|
||||
|
||||
generate_inx_files()
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>100 file input</_name>
|
||||
<id>org.inkstitch.input.100</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.100</extension>
|
||||
<mimetype>application/x-embroidery-100</mimetype>
|
||||
<_filetypename>Ink/Stitch: Toyota Embroidery Format (.100)</_filetypename>
|
||||
<_filetypetooltip>convert 100 file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>10O file input</_name>
|
||||
<id>org.inkstitch.input.10o</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.10o</extension>
|
||||
<mimetype>application/x-embroidery-10o</mimetype>
|
||||
<_filetypename>Ink/Stitch: Toyota Embroidery Format (.10o)</_filetypename>
|
||||
<_filetypetooltip>convert 10O file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>BRO file input</_name>
|
||||
<id>org.inkstitch.input.bro</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.bro</extension>
|
||||
<mimetype>application/x-embroidery-bro</mimetype>
|
||||
<_filetypename>Ink/Stitch: Bits & Volts Embroidery Format (.bro)</_filetypename>
|
||||
<_filetypetooltip>convert BRO file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>DSB file input</_name>
|
||||
<id>org.inkstitch.input.dsb</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.dsb</extension>
|
||||
<mimetype>application/x-embroidery-dsb</mimetype>
|
||||
<_filetypename>Ink/Stitch: Tajima(Barudan) Embroidery Format (.dsb)</_filetypename>
|
||||
<_filetypetooltip>convert DSB file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>DST file input</_name>
|
||||
<id>org.inkstitch.input.dst</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.dst</extension>
|
||||
<mimetype>application/x-embroidery-dst</mimetype>
|
||||
<_filetypename>Ink/Stitch: Tajima Embroidery Format (.dst)</_filetypename>
|
||||
<_filetypetooltip>convert DST file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>DSZ file input</_name>
|
||||
<id>org.inkstitch.input.dsz</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.dsz</extension>
|
||||
<mimetype>application/x-embroidery-dsz</mimetype>
|
||||
<_filetypename>Ink/Stitch: ZSK USA Embroidery Format (.dsz)</_filetypename>
|
||||
<_filetypetooltip>convert DSZ file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>EMD file input</_name>
|
||||
<id>org.inkstitch.input.emd</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.emd</extension>
|
||||
<mimetype>application/x-embroidery-emd</mimetype>
|
||||
<_filetypename>Ink/Stitch: Elna Embroidery Format (.emd)</_filetypename>
|
||||
<_filetypetooltip>convert EMD file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>EXP file input</_name>
|
||||
<id>org.inkstitch.input.exp</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.exp</extension>
|
||||
<mimetype>application/x-embroidery-exp</mimetype>
|
||||
<_filetypename>Ink/Stitch: Melco Embroidery Format (.exp)</_filetypename>
|
||||
<_filetypetooltip>convert EXP file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>INB file input</_name>
|
||||
<id>org.inkstitch.input.inb</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.inb</extension>
|
||||
<mimetype>application/x-embroidery-inb</mimetype>
|
||||
<_filetypename>Ink/Stitch: Inbro Embroidery Format (.inb)</_filetypename>
|
||||
<_filetypetooltip>convert INB file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>JEF file input</_name>
|
||||
<id>org.inkstitch.input.jef</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.jef</extension>
|
||||
<mimetype>application/x-embroidery-jef</mimetype>
|
||||
<_filetypename>Ink/Stitch: Janome Embroidery Format (.jef)</_filetypename>
|
||||
<_filetypetooltip>convert JEF file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>KSM file input</_name>
|
||||
<id>org.inkstitch.input.ksm</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.ksm</extension>
|
||||
<mimetype>application/x-embroidery-ksm</mimetype>
|
||||
<_filetypename>Ink/Stitch: Pfaff Embroidery Format (.ksm)</_filetypename>
|
||||
<_filetypetooltip>convert KSM file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>PEC file input</_name>
|
||||
<id>org.inkstitch.input.pec</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.pec</extension>
|
||||
<mimetype>application/x-embroidery-pec</mimetype>
|
||||
<_filetypename>Ink/Stitch: Brother Embroidery Format (.pec)</_filetypename>
|
||||
<_filetypetooltip>convert PEC file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>PES file input</_name>
|
||||
<id>org.inkstitch.input.pes</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.pes</extension>
|
||||
<mimetype>application/x-embroidery-pes</mimetype>
|
||||
<_filetypename>Ink/Stitch: Brother Embroidery Format (.pes)</_filetypename>
|
||||
<_filetypetooltip>convert PES file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>SEW file input</_name>
|
||||
<id>org.inkstitch.input.sew</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.sew</extension>
|
||||
<mimetype>application/x-embroidery-sew</mimetype>
|
||||
<_filetypename>Ink/Stitch: Janome Embroidery Format (.sew)</_filetypename>
|
||||
<_filetypetooltip>convert SEW file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>SHV file input</_name>
|
||||
<id>org.inkstitch.input.shv</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.shv</extension>
|
||||
<mimetype>application/x-embroidery-shv</mimetype>
|
||||
<_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.shv)</_filetypename>
|
||||
<_filetypetooltip>convert SHV file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>STX file input</_name>
|
||||
<id>org.inkstitch.input.stx</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.stx</extension>
|
||||
<mimetype>application/x-embroidery-stx</mimetype>
|
||||
<_filetypename>Ink/Stitch: Data Stitch Embroidery Format (.stx)</_filetypename>
|
||||
<_filetypetooltip>convert STX file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>TAP file input</_name>
|
||||
<id>org.inkstitch.input.tap</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.tap</extension>
|
||||
<mimetype>application/x-embroidery-tap</mimetype>
|
||||
<_filetypename>Ink/Stitch: Happy Embroidery Format (.tap)</_filetypename>
|
||||
<_filetypetooltip>convert TAP file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>TBF file input</_name>
|
||||
<id>org.inkstitch.input.tbf</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.tbf</extension>
|
||||
<mimetype>application/x-embroidery-tbf</mimetype>
|
||||
<_filetypename>Ink/Stitch: Tajima Embroidery Format (.tbf)</_filetypename>
|
||||
<_filetypetooltip>convert TBF file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>U01 file input</_name>
|
||||
<id>org.inkstitch.input.u01</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.u01</extension>
|
||||
<mimetype>application/x-embroidery-u01</mimetype>
|
||||
<_filetypename>Ink/Stitch: Barudan Embroidery Format (.u01)</_filetypename>
|
||||
<_filetypetooltip>convert U01 file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>VP3 file input</_name>
|
||||
<id>org.inkstitch.input.vp3</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.vp3</extension>
|
||||
<mimetype>application/x-embroidery-vp3</mimetype>
|
||||
<_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vp3)</_filetypename>
|
||||
<_filetypetooltip>convert VP3 file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>XXX file input</_name>
|
||||
<id>org.inkstitch.input.xxx</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<input>
|
||||
<extension>.xxx</extension>
|
||||
<mimetype>application/x-embroidery-xxx</mimetype>
|
||||
<_filetypename>Ink/Stitch: Singer Embroidery Format (.xxx)</_filetypename>
|
||||
<_filetypetooltip>convert XXX file to Ink/Stitch manual-stitch paths</_filetypetooltip>
|
||||
</input>
|
||||
<param name="extension" type="string" gui-hidden="true">input</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>DST file output</_name>
|
||||
<id>org.inkstitch.output.dst</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.dst</extension>
|
||||
<mimetype>application/x-embroidery-dst</mimetype>
|
||||
<_filetypename>Ink/Stitch: Tajima Embroidery Format (.dst)</_filetypename>
|
||||
<_filetypetooltip>Save design in DST format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">dst</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>EXP file output</_name>
|
||||
<id>org.inkstitch.output.exp</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.exp</extension>
|
||||
<mimetype>application/x-embroidery-exp</mimetype>
|
||||
<_filetypename>Ink/Stitch: Melco Embroidery Format (.exp)</_filetypename>
|
||||
<_filetypetooltip>Save design in EXP format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">exp</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>JEF file output</_name>
|
||||
<id>org.inkstitch.output.jef</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.jef</extension>
|
||||
<mimetype>application/x-embroidery-jef</mimetype>
|
||||
<_filetypename>Ink/Stitch: Janome Embroidery Format (.jef)</_filetypename>
|
||||
<_filetypetooltip>Save design in JEF format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">jef</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>PEC file output</_name>
|
||||
<id>org.inkstitch.output.pec</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.pec</extension>
|
||||
<mimetype>application/x-embroidery-pec</mimetype>
|
||||
<_filetypename>Ink/Stitch: Brother Embroidery Format (.pec)</_filetypename>
|
||||
<_filetypetooltip>Save design in PEC format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">pec</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>PES file output</_name>
|
||||
<id>org.inkstitch.output.pes</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.pes</extension>
|
||||
<mimetype>application/x-embroidery-pes</mimetype>
|
||||
<_filetypename>Ink/Stitch: Brother Embroidery Format (.pes)</_filetypename>
|
||||
<_filetypetooltip>Save design in PES format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">pes</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>VP3 file output</_name>
|
||||
<id>org.inkstitch.output.vp3</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.vp3</extension>
|
||||
<mimetype>application/x-embroidery-vp3</mimetype>
|
||||
<_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vp3)</_filetypename>
|
||||
<_filetypetooltip>Save design in VP3 format using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
<param name="extension" type="string" gui-hidden="true">output</param>
|
||||
<param name="format" type="string" gui-hidden="true">vp3</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
|
||||
<_name>embroidery ZIP file output</_name>
|
||||
<id>org.inkstitch.output.zip</id>
|
||||
<dependency type="executable" location="extensions">inkstitch.py</dependency>
|
||||
<dependency type="executable" location="extensions">inkex.py</dependency>
|
||||
<output>
|
||||
<extension>.zip</extension>
|
||||
<mimetype>application/zip</mimetype>
|
||||
<_filetypename>Ink/Stitch: ZIP export multiple formats (.zip)</_filetypename>
|
||||
<_filetypetooltip>Create a ZIP with multiple embroidery file formats using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
|
||||
<param name="format-pec" type="boolean" _gui-text=".PEC: Brother Embroidery Format">false</param>
|
||||
|
||||
<param name="format-pes" type="boolean" _gui-text=".PES: Brother Embroidery Format">false</param>
|
||||
|
||||
<param name="format-exp" type="boolean" _gui-text=".EXP: Melco Embroidery Format">false</param>
|
||||
|
||||
<param name="format-dst" type="boolean" _gui-text=".DST: Tajima Embroidery Format">false</param>
|
||||
|
||||
<param name="format-jef" type="boolean" _gui-text=".JEF: Janome Embroidery Format">false</param>
|
||||
|
||||
<param name="format-vp3" type="boolean" _gui-text=".VP3: Pfaff Embroidery Format">false</param>
|
||||
|
||||
<param name="extension" type="string" gui-hidden="true">zip</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
||||
</script>
|
||||
</inkscape-extension>
|
|
@ -10,3 +10,13 @@ from flip import Flip
|
|||
from object_commands import ObjectCommands
|
||||
from layer_commands import LayerCommands
|
||||
from convert_to_satin import ConvertToSatin
|
||||
|
||||
from base import InkstitchExtension
|
||||
import inspect
|
||||
|
||||
extensions = []
|
||||
for item in locals().values():
|
||||
if inspect.isclass(item) and \
|
||||
issubclass(item, InkstitchExtension) and \
|
||||
item is not InkstitchExtension:
|
||||
extensions.append(item)
|
||||
|
|
|
@ -3,6 +3,7 @@ import re
|
|||
import json
|
||||
from copy import deepcopy
|
||||
from collections import MutableMapping
|
||||
from stringcase import snakecase
|
||||
|
||||
from ..svg.tags import *
|
||||
from ..elements import AutoFill, Fill, Stroke, SatinColumn, Polyline, EmbroideryElement
|
||||
|
@ -98,6 +99,10 @@ class InkStitchMetadata(MutableMapping):
|
|||
class InkstitchExtension(inkex.Effect):
|
||||
"""Base class for Inkstitch extensions. Not intended for direct use."""
|
||||
|
||||
@classmethod
|
||||
def name(cls):
|
||||
return snakecase(cls.__name__)
|
||||
|
||||
def hide_all_layers(self):
|
||||
for g in self.document.getroot().findall(SVG_GROUP_TAG):
|
||||
if g.get(INKSCAPE_GROUPMODE) == "layer":
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from generate import generate_inx_files
|
|
@ -0,0 +1,21 @@
|
|||
import pyembroidery
|
||||
|
||||
from .utils import build_environment, write_inx_file
|
||||
from .outputs import pyembroidery_output_formats
|
||||
from ..extensions import extensions
|
||||
|
||||
|
||||
def pyembroidery_debug_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'writer' in format and format['category'] != 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def generate_extension_inx_files():
|
||||
env = build_environment()
|
||||
|
||||
for extension in extensions:
|
||||
name = extension.name()
|
||||
template = env.get_template('%s.inx' % name)
|
||||
write_inx_file(name, template.render(formats=pyembroidery_output_formats(),
|
||||
debug_formats=pyembroidery_debug_formats()))
|
|
@ -0,0 +1,8 @@
|
|||
from .inputs import generate_input_inx_files
|
||||
from .outputs import generate_output_inx_files
|
||||
from .extensions import generate_extension_inx_files
|
||||
|
||||
def generate_inx_files():
|
||||
generate_input_inx_files()
|
||||
generate_output_inx_files()
|
||||
generate_extension_inx_files()
|
|
@ -0,0 +1,18 @@
|
|||
import pyembroidery
|
||||
|
||||
from .utils import build_environment, write_inx_file
|
||||
|
||||
|
||||
def pyembroidery_input_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'reader' in format and format['category'] == 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def generate_input_inx_files():
|
||||
env = build_environment()
|
||||
template = env.get_template('input.inx')
|
||||
|
||||
for format, description in pyembroidery_input_formats():
|
||||
name = "input_%s" % format.upper()
|
||||
write_inx_file(name, template.render(format=format, description=description))
|
|
@ -0,0 +1,18 @@
|
|||
import pyembroidery
|
||||
|
||||
from .utils import build_environment, write_inx_file
|
||||
|
||||
|
||||
def pyembroidery_output_formats():
|
||||
for format in pyembroidery.supported_formats():
|
||||
if 'writer' in format and format['category'] == 'embroidery':
|
||||
yield format['extension'], format['description']
|
||||
|
||||
|
||||
def generate_output_inx_files():
|
||||
env = build_environment()
|
||||
template = env.get_template('output.inx')
|
||||
|
||||
for format, description in pyembroidery_output_formats():
|
||||
name = "output_%s" % format.upper()
|
||||
write_inx_file(name, template.render(format=format, description=description))
|
|
@ -0,0 +1,26 @@
|
|||
import os
|
||||
from os.path import dirname
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
from ..i18n import translation as inkstitch_translation
|
||||
|
||||
|
||||
_top_path = dirname(dirname(dirname(os.path.realpath(__file__))))
|
||||
inx_path = os.path.join(_top_path, "inx")
|
||||
template_path = os.path.join(_top_path, "templates")
|
||||
|
||||
def build_environment():
|
||||
env = Environment(
|
||||
loader = FileSystemLoader(template_path),
|
||||
autoescape = True,
|
||||
extensions=['jinja2.ext.i18n']
|
||||
)
|
||||
|
||||
env.install_gettext_translations(inkstitch_translation)
|
||||
|
||||
return env
|
||||
|
||||
def write_inx_file(name, contents):
|
||||
inx_file_name = "inkstitch_%s.inx" % name
|
||||
with open(os.path.join(inx_path, inx_file_name), 'w') as inx_file:
|
||||
print >> inx_file, contents
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2018-08-17 23:02-0400\n"
|
||||
"POT-Creation-Date: 2018-08-19 22:14-0400\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"
|
||||
|
@ -369,15 +369,15 @@ msgid ""
|
|||
"be dashed to indicate running stitch. Any kind of dash will work."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/base.py:108
|
||||
#: lib/extensions/base.py:113
|
||||
msgid "No embroiderable paths selected."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/base.py:110
|
||||
#: lib/extensions/base.py:115
|
||||
msgid "No embroiderable paths found in document."
|
||||
msgstr ""
|
||||
|
||||
#: lib/extensions/base.py:111
|
||||
#: lib/extensions/base.py:116
|
||||
msgid "Tip: use Path -> Object to Path to convert non-paths."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ numpy
|
|||
jinja2
|
||||
requests
|
||||
colormath
|
||||
stringcase
|
||||
|
||||
# We're not ready for flask 1.0 yet. Logging changed, among othe things.
|
||||
flask==0.*
|
||||
|
|
|
@ -7,14 +7,12 @@
|
|||
<param name="collapse_len_mm" type="float" min="0.0" max="10.0" _gui-text="Collapse length (mm)" _gui-description="Jump stitches smaller than this will be treated as normal stitches.">3.0</param>
|
||||
<param name="hide_layers" type="boolean" _gui-text="Hide other layers" _gui-description="Hide all other top-level layers when the embroidery layer is generated, in order to make stitching discernable.">true</param>
|
||||
<param name="output_format" type="optiongroup" _gui-text="Output file format" appearance="minimal">
|
||||
<_option value="dst">Tajima Embroidery Format (DST)</_option>
|
||||
<_option value="exp">Melco Embroidery Format (EXP)</_option>
|
||||
<_option value="jef">Janome Embroidery Format (JEF)</_option>
|
||||
<_option value="pec">Brother Embroidery Format (PEC)</_option>
|
||||
<_option value="pes">Brother Embroidery Format (PES)</_option>
|
||||
<_option value="vp3">Pfaff Embroidery Format (VP3)</_option>
|
||||
<_option value="csv">Comma-separated values (CSV) [DEBUG]</_option>
|
||||
<_option value="svg">Scalable Vector Graphics (SVG) [DEBUG]</_option>
|
||||
{% for format, description in formats %}
|
||||
<_option value="{{ format }}">{{ description }} ({{ format | upper }})</_option>
|
||||
{% endfor %}
|
||||
{% for format, description in debug_formats %}
|
||||
<_option value="{{ format }}">{{ description }} ({{ format | upper }}) [DEBUG]</_option>
|
||||
{% endfor %}
|
||||
</param>
|
||||
<param name="path" type="string" _gui-text="Directory" _gui-description="Leave empty to save the output in Inkscape's extension directory."></param>
|
||||
<param name="extension" type="string" gui-hidden="true">embroider</param>
|
|
@ -11,9 +11,9 @@
|
|||
<_filetypetooltip>Create a ZIP with multiple embroidery file formats using Ink/Stitch</_filetypetooltip>
|
||||
<dataloss>true</dataloss>
|
||||
</output>
|
||||
{% for format, description in formats %}
|
||||
<param name="format-{{format}}" type="boolean" _gui-text=".{{format | upper}}: {{description}}">false</param>
|
||||
{% endfor %}
|
||||
{% for format, description in formats %}
|
||||
<param name="format-{{ format }}" type="boolean" _gui-text=".{{ format | upper }}: {{ description }}">false</param>
|
||||
{% endfor %}
|
||||
<param name="extension" type="string" gui-hidden="true">zip</param>
|
||||
<script>
|
||||
<command reldir="extensions" interpreter="python">inkstitch.py</command>
|
Ładowanie…
Reference in New Issue