add zip INX generator and INX

pull/198/head
Lex Neva 2018-06-12 21:48:38 -04:00
rodzic ede0e766d8
commit b4dd5a1e8f
4 zmienionych plików z 127 dodań i 1 usunięć

44
bin/gen-zip-inx 100755
Wyświetl plik

@ -0,0 +1,44 @@
#!/usr/bin/env python
import sys, os
from os.path import dirname
from libembroidery import *
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 libembroidery_output_formats():
formatList = embFormatList_create()
curFormat = formatList
while(curFormat):
extension = embFormat_extension(curFormat)
description = embFormat_description(curFormat)
writer_state = embFormat_writerState(curFormat)
if writer_state.strip() and embFormat_type(curFormat) != EMBFORMAT_OBJECTONLY:
# extension includes the dot, so we'll remove it
yield extension[1:], description
curFormat = curFormat.next
def main():
env = build_environment()
template = env.get_template('embroider_zip_output.inx')
inx = template.render(formats=libembroidery_output_formats())
with open("inx/inkstitch_output_ZIP.inx", 'w') as inx_file:
inx_file.write(inx)
if __name__ == "__main__":
sys.exit(main())

Wyświetl plik

@ -0,0 +1,61 @@
<?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-col" type="boolean" _gui-text=".COL: Embroidery Thread Color Format">false</param>
<param name="format-csv" type="boolean" _gui-text=".CSV: Comma Separated Values Format">false</param>
<param name="format-dst" type="boolean" _gui-text=".DST: Tajima Embroidery Format">false</param>
<param name="format-edr" type="boolean" _gui-text=".EDR: Embird Embroidery Format">false</param>
<param name="format-exp" type="boolean" _gui-text=".EXP: Melco Embroidery Format">false</param>
<param name="format-hus" type="boolean" _gui-text=".HUS: Husqvarna Viking Embroidery Format">false</param>
<param name="format-inf" type="boolean" _gui-text=".INF: Embroidery Color Format">false</param>
<param name="format-jef" type="boolean" _gui-text=".JEF: Janome Embroidery Format">false</param>
<param name="format-ksm" type="boolean" _gui-text=".KSM: Pfaff Embroidery Format">false</param>
<param name="format-max" type="boolean" _gui-text=".MAX: Pfaff Embroidery Format">false</param>
<param name="format-pcd" type="boolean" _gui-text=".PCD: Pfaff Embroidery Format">false</param>
<param name="format-pcq" type="boolean" _gui-text=".PCQ: Pfaff Embroidery Format">false</param>
<param name="format-pcs" type="boolean" _gui-text=".PCS: Pfaff Embroidery Format">false</param>
<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-plt" type="boolean" _gui-text=".PLT: AutoCAD Plot Drawing Format">false</param>
<param name="format-rgb" type="boolean" _gui-text=".RGB: RGB Embroidery Format">false</param>
<param name="format-thr" type="boolean" _gui-text=".THR: ThredWorks Embroidery Format">false</param>
<param name="format-txt" type="boolean" _gui-text=".TXT: Text File">false</param>
<param name="format-vp3" type="boolean" _gui-text=".VP3: Pfaff Embroidery Format">false</param>
<param name="format-xxx" type="boolean" _gui-text=".XXX: Singer 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>

Wyświetl plik

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-06-12 20:18-0400\n"
"POT-Creation-Date: 2018-06-15 21:44-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"

Wyświetl plik

@ -0,0 +1,21 @@
<?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>
{% 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>
</script>
</inkscape-extension>