From 40a343128043b7d2ebe3a770dfae887e969fc5e0 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 12 Jun 2018 20:54:51 -0400 Subject: add output INX generator --- inx/inkstitch_output_COL.inx | 19 +++++++++++++++++++ inx/inkstitch_output_CSV.inx | 19 +++++++++++++++++++ inx/inkstitch_output_DST.inx | 19 +++++++++++++++++++ inx/inkstitch_output_EDR.inx | 19 +++++++++++++++++++ inx/inkstitch_output_EXP.inx | 19 +++++++++++++++++++ inx/inkstitch_output_HUS.inx | 19 +++++++++++++++++++ inx/inkstitch_output_INF.inx | 19 +++++++++++++++++++ inx/inkstitch_output_JEF.inx | 19 +++++++++++++++++++ inx/inkstitch_output_KSM.inx | 19 +++++++++++++++++++ inx/inkstitch_output_MAX.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PCD.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PCQ.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PCS.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PEC.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PES.inx | 19 +++++++++++++++++++ inx/inkstitch_output_PLT.inx | 19 +++++++++++++++++++ inx/inkstitch_output_RGB.inx | 19 +++++++++++++++++++ inx/inkstitch_output_THR.inx | 19 +++++++++++++++++++ inx/inkstitch_output_TXT.inx | 19 +++++++++++++++++++ inx/inkstitch_output_VP3.inx | 19 +++++++++++++++++++ inx/inkstitch_output_XXX.inx | 19 +++++++++++++++++++ 21 files changed, 399 insertions(+) create mode 100644 inx/inkstitch_output_COL.inx create mode 100644 inx/inkstitch_output_CSV.inx create mode 100644 inx/inkstitch_output_DST.inx create mode 100644 inx/inkstitch_output_EDR.inx create mode 100644 inx/inkstitch_output_EXP.inx create mode 100644 inx/inkstitch_output_HUS.inx create mode 100644 inx/inkstitch_output_INF.inx create mode 100644 inx/inkstitch_output_JEF.inx create mode 100644 inx/inkstitch_output_KSM.inx create mode 100644 inx/inkstitch_output_MAX.inx create mode 100644 inx/inkstitch_output_PCD.inx create mode 100644 inx/inkstitch_output_PCQ.inx create mode 100644 inx/inkstitch_output_PCS.inx create mode 100644 inx/inkstitch_output_PEC.inx create mode 100644 inx/inkstitch_output_PES.inx create mode 100644 inx/inkstitch_output_PLT.inx create mode 100644 inx/inkstitch_output_RGB.inx create mode 100644 inx/inkstitch_output_THR.inx create mode 100644 inx/inkstitch_output_TXT.inx create mode 100644 inx/inkstitch_output_VP3.inx create mode 100644 inx/inkstitch_output_XXX.inx (limited to 'inx') diff --git a/inx/inkstitch_output_COL.inx b/inx/inkstitch_output_COL.inx new file mode 100644 index 00000000..8a240a38 --- /dev/null +++ b/inx/inkstitch_output_COL.inx @@ -0,0 +1,19 @@ + + + <_name>COL file output + org.inkstitch.output.col + inkstitch.py + inkex.py + + .col + application/x-embroidery-col + <_filetypename>Ink/Stitch: Embroidery Thread Color Format (.col) + <_filetypetooltip>Save design in COL format using Ink/Stitch + true + + output + col + + \ No newline at end of file diff --git a/inx/inkstitch_output_CSV.inx b/inx/inkstitch_output_CSV.inx new file mode 100644 index 00000000..d2f340cd --- /dev/null +++ b/inx/inkstitch_output_CSV.inx @@ -0,0 +1,19 @@ + + + <_name>CSV file output + org.inkstitch.output.csv + inkstitch.py + inkex.py + + .csv + application/x-embroidery-csv + <_filetypename>Ink/Stitch: Comma Separated Values Format (.csv) + <_filetypetooltip>Save design in CSV format using Ink/Stitch + true + + output + csv + + \ No newline at end of file diff --git a/inx/inkstitch_output_DST.inx b/inx/inkstitch_output_DST.inx new file mode 100644 index 00000000..2230600a --- /dev/null +++ b/inx/inkstitch_output_DST.inx @@ -0,0 +1,19 @@ + + + <_name>DST file output + org.inkstitch.output.dst + inkstitch.py + inkex.py + + .dst + application/x-embroidery-dst + <_filetypename>Ink/Stitch: Tajima Embroidery Format (.dst) + <_filetypetooltip>Save design in DST format using Ink/Stitch + true + + output + dst + + \ No newline at end of file diff --git a/inx/inkstitch_output_EDR.inx b/inx/inkstitch_output_EDR.inx new file mode 100644 index 00000000..0756b37a --- /dev/null +++ b/inx/inkstitch_output_EDR.inx @@ -0,0 +1,19 @@ + + + <_name>EDR file output + org.inkstitch.output.edr + inkstitch.py + inkex.py + + .edr + application/x-embroidery-edr + <_filetypename>Ink/Stitch: Embird Embroidery Format (.edr) + <_filetypetooltip>Save design in EDR format using Ink/Stitch + true + + output + edr + + \ No newline at end of file diff --git a/inx/inkstitch_output_EXP.inx b/inx/inkstitch_output_EXP.inx new file mode 100644 index 00000000..ce98dbc0 --- /dev/null +++ b/inx/inkstitch_output_EXP.inx @@ -0,0 +1,19 @@ + + + <_name>EXP file output + org.inkstitch.output.exp + inkstitch.py + inkex.py + + .exp + application/x-embroidery-exp + <_filetypename>Ink/Stitch: Melco Embroidery Format (.exp) + <_filetypetooltip>Save design in EXP format using Ink/Stitch + true + + output + exp + + \ No newline at end of file diff --git a/inx/inkstitch_output_HUS.inx b/inx/inkstitch_output_HUS.inx new file mode 100644 index 00000000..44536f2a --- /dev/null +++ b/inx/inkstitch_output_HUS.inx @@ -0,0 +1,19 @@ + + + <_name>HUS file output + org.inkstitch.output.hus + inkstitch.py + inkex.py + + .hus + application/x-embroidery-hus + <_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.hus) + <_filetypetooltip>Save design in HUS format using Ink/Stitch + true + + output + hus + + \ No newline at end of file diff --git a/inx/inkstitch_output_INF.inx b/inx/inkstitch_output_INF.inx new file mode 100644 index 00000000..47c2b63e --- /dev/null +++ b/inx/inkstitch_output_INF.inx @@ -0,0 +1,19 @@ + + + <_name>INF file output + org.inkstitch.output.inf + inkstitch.py + inkex.py + + .inf + application/x-embroidery-inf + <_filetypename>Ink/Stitch: Embroidery Color Format (.inf) + <_filetypetooltip>Save design in INF format using Ink/Stitch + true + + output + inf + + \ No newline at end of file diff --git a/inx/inkstitch_output_JEF.inx b/inx/inkstitch_output_JEF.inx new file mode 100644 index 00000000..af92a836 --- /dev/null +++ b/inx/inkstitch_output_JEF.inx @@ -0,0 +1,19 @@ + + + <_name>JEF file output + org.inkstitch.output.jef + inkstitch.py + inkex.py + + .jef + application/x-embroidery-jef + <_filetypename>Ink/Stitch: Janome Embroidery Format (.jef) + <_filetypetooltip>Save design in JEF format using Ink/Stitch + true + + output + jef + + \ No newline at end of file diff --git a/inx/inkstitch_output_KSM.inx b/inx/inkstitch_output_KSM.inx new file mode 100644 index 00000000..ad5ae4dd --- /dev/null +++ b/inx/inkstitch_output_KSM.inx @@ -0,0 +1,19 @@ + + + <_name>KSM file output + org.inkstitch.output.ksm + inkstitch.py + inkex.py + + .ksm + application/x-embroidery-ksm + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.ksm) + <_filetypetooltip>Save design in KSM format using Ink/Stitch + true + + output + ksm + + \ No newline at end of file diff --git a/inx/inkstitch_output_MAX.inx b/inx/inkstitch_output_MAX.inx new file mode 100644 index 00000000..45a5ba01 --- /dev/null +++ b/inx/inkstitch_output_MAX.inx @@ -0,0 +1,19 @@ + + + <_name>MAX file output + org.inkstitch.output.max + inkstitch.py + inkex.py + + .max + application/x-embroidery-max + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.max) + <_filetypetooltip>Save design in MAX format using Ink/Stitch + true + + output + max + + \ No newline at end of file diff --git a/inx/inkstitch_output_PCD.inx b/inx/inkstitch_output_PCD.inx new file mode 100644 index 00000000..b42f79de --- /dev/null +++ b/inx/inkstitch_output_PCD.inx @@ -0,0 +1,19 @@ + + + <_name>PCD file output + org.inkstitch.output.pcd + inkstitch.py + inkex.py + + .pcd + application/x-embroidery-pcd + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcd) + <_filetypetooltip>Save design in PCD format using Ink/Stitch + true + + output + pcd + + \ No newline at end of file diff --git a/inx/inkstitch_output_PCQ.inx b/inx/inkstitch_output_PCQ.inx new file mode 100644 index 00000000..1764f670 --- /dev/null +++ b/inx/inkstitch_output_PCQ.inx @@ -0,0 +1,19 @@ + + + <_name>PCQ file output + org.inkstitch.output.pcq + inkstitch.py + inkex.py + + .pcq + application/x-embroidery-pcq + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcq) + <_filetypetooltip>Save design in PCQ format using Ink/Stitch + true + + output + pcq + + \ No newline at end of file diff --git a/inx/inkstitch_output_PCS.inx b/inx/inkstitch_output_PCS.inx new file mode 100644 index 00000000..ef07c4bd --- /dev/null +++ b/inx/inkstitch_output_PCS.inx @@ -0,0 +1,19 @@ + + + <_name>PCS file output + org.inkstitch.output.pcs + inkstitch.py + inkex.py + + .pcs + application/x-embroidery-pcs + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcs) + <_filetypetooltip>Save design in PCS format using Ink/Stitch + true + + output + pcs + + \ No newline at end of file diff --git a/inx/inkstitch_output_PEC.inx b/inx/inkstitch_output_PEC.inx new file mode 100644 index 00000000..15880ce6 --- /dev/null +++ b/inx/inkstitch_output_PEC.inx @@ -0,0 +1,19 @@ + + + <_name>PEC file output + org.inkstitch.output.pec + inkstitch.py + inkex.py + + .pec + application/x-embroidery-pec + <_filetypename>Ink/Stitch: Brother Embroidery Format (.pec) + <_filetypetooltip>Save design in PEC format using Ink/Stitch + true + + output + pec + + \ No newline at end of file diff --git a/inx/inkstitch_output_PES.inx b/inx/inkstitch_output_PES.inx new file mode 100644 index 00000000..cd7e7369 --- /dev/null +++ b/inx/inkstitch_output_PES.inx @@ -0,0 +1,19 @@ + + + <_name>PES file output + org.inkstitch.output.pes + inkstitch.py + inkex.py + + .pes + application/x-embroidery-pes + <_filetypename>Ink/Stitch: Brother Embroidery Format (.pes) + <_filetypetooltip>Save design in PES format using Ink/Stitch + true + + output + pes + + \ No newline at end of file diff --git a/inx/inkstitch_output_PLT.inx b/inx/inkstitch_output_PLT.inx new file mode 100644 index 00000000..649ef76b --- /dev/null +++ b/inx/inkstitch_output_PLT.inx @@ -0,0 +1,19 @@ + + + <_name>PLT file output + org.inkstitch.output.plt + inkstitch.py + inkex.py + + .plt + application/x-embroidery-plt + <_filetypename>Ink/Stitch: AutoCAD Plot Drawing Format (.plt) + <_filetypetooltip>Save design in PLT format using Ink/Stitch + true + + output + plt + + \ No newline at end of file diff --git a/inx/inkstitch_output_RGB.inx b/inx/inkstitch_output_RGB.inx new file mode 100644 index 00000000..e60d729e --- /dev/null +++ b/inx/inkstitch_output_RGB.inx @@ -0,0 +1,19 @@ + + + <_name>RGB file output + org.inkstitch.output.rgb + inkstitch.py + inkex.py + + .rgb + application/x-embroidery-rgb + <_filetypename>Ink/Stitch: RGB Embroidery Format (.rgb) + <_filetypetooltip>Save design in RGB format using Ink/Stitch + true + + output + rgb + + \ No newline at end of file diff --git a/inx/inkstitch_output_THR.inx b/inx/inkstitch_output_THR.inx new file mode 100644 index 00000000..c460bdfc --- /dev/null +++ b/inx/inkstitch_output_THR.inx @@ -0,0 +1,19 @@ + + + <_name>THR file output + org.inkstitch.output.thr + inkstitch.py + inkex.py + + .thr + application/x-embroidery-thr + <_filetypename>Ink/Stitch: ThredWorks Embroidery Format (.thr) + <_filetypetooltip>Save design in THR format using Ink/Stitch + true + + output + thr + + \ No newline at end of file diff --git a/inx/inkstitch_output_TXT.inx b/inx/inkstitch_output_TXT.inx new file mode 100644 index 00000000..805deffe --- /dev/null +++ b/inx/inkstitch_output_TXT.inx @@ -0,0 +1,19 @@ + + + <_name>TXT file output + org.inkstitch.output.txt + inkstitch.py + inkex.py + + .txt + application/x-embroidery-txt + <_filetypename>Ink/Stitch: Text File (.txt) + <_filetypetooltip>Save design in TXT format using Ink/Stitch + true + + output + txt + + \ No newline at end of file diff --git a/inx/inkstitch_output_VP3.inx b/inx/inkstitch_output_VP3.inx new file mode 100644 index 00000000..dff29de4 --- /dev/null +++ b/inx/inkstitch_output_VP3.inx @@ -0,0 +1,19 @@ + + + <_name>VP3 file output + org.inkstitch.output.vp3 + inkstitch.py + inkex.py + + .vp3 + application/x-embroidery-vp3 + <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vp3) + <_filetypetooltip>Save design in VP3 format using Ink/Stitch + true + + output + vp3 + + \ No newline at end of file diff --git a/inx/inkstitch_output_XXX.inx b/inx/inkstitch_output_XXX.inx new file mode 100644 index 00000000..ad4135b0 --- /dev/null +++ b/inx/inkstitch_output_XXX.inx @@ -0,0 +1,19 @@ + + + <_name>XXX file output + org.inkstitch.output.xxx + inkstitch.py + inkex.py + + .xxx + application/x-embroidery-xxx + <_filetypename>Ink/Stitch: Singer Embroidery Format (.xxx) + <_filetypetooltip>Save design in XXX format using Ink/Stitch + true + + output + xxx + + \ No newline at end of file -- cgit v1.3.1 From b4dd5a1e8fac21b4d40e3a839715834ea243e49a Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 12 Jun 2018 21:48:38 -0400 Subject: add zip INX generator and INX --- bin/gen-zip-inx | 44 +++++++++++++++++++++++++++ inx/inkstitch_output_ZIP.inx | 61 ++++++++++++++++++++++++++++++++++++++ messages.po | 2 +- templates/embroider_zip_output.inx | 21 +++++++++++++ 4 files changed, 127 insertions(+), 1 deletion(-) create mode 100755 bin/gen-zip-inx create mode 100644 inx/inkstitch_output_ZIP.inx create mode 100644 templates/embroider_zip_output.inx (limited to 'inx') diff --git a/bin/gen-zip-inx b/bin/gen-zip-inx new file mode 100755 index 00000000..5fbc8f1e --- /dev/null +++ b/bin/gen-zip-inx @@ -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()) diff --git a/inx/inkstitch_output_ZIP.inx b/inx/inkstitch_output_ZIP.inx new file mode 100644 index 00000000..b5b2cf1c --- /dev/null +++ b/inx/inkstitch_output_ZIP.inx @@ -0,0 +1,61 @@ + + + <_name>embroidery ZIP file output + org.inkstitch.output.zip + inkstitch.py + inkex.py + + .zip + application/zip + <_filetypename>Ink/Stitch: ZIP export multiple formats (.zip) + <_filetypetooltip>Create a ZIP with multiple embroidery file formats using Ink/Stitch + true + + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + false + + zip + + diff --git a/messages.po b/messages.po index b872f864..36af2e50 100644 --- a/messages.po +++ b/messages.po @@ -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 \n" "Language-Team: LANGUAGE \n" diff --git a/templates/embroider_zip_output.inx b/templates/embroider_zip_output.inx new file mode 100644 index 00000000..5d162357 --- /dev/null +++ b/templates/embroider_zip_output.inx @@ -0,0 +1,21 @@ + + + <_name>embroidery ZIP file output + org.inkstitch.output.zip + inkstitch.py + inkex.py + + .zip + application/zip + <_filetypename>Ink/Stitch: ZIP export multiple formats (.zip) + <_filetypetooltip>Create a ZIP with multiple embroidery file formats using Ink/Stitch + true + +{% for format, description in formats %} + false +{% endfor %} + zip + + -- cgit v1.3.1 From 0e4fab06c4bec76d90e7f18580b0272ce74af439 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 24 Jun 2018 15:55:13 -0400 Subject: installer now installs symbols too --- inx/inkstitch_install.inx | 17 +++++++ inx/inkstitch_palettes.inx | 17 ------- lib/extensions/__init__.py | 2 +- lib/extensions/install.py | 123 +++++++++++++++++++++++++++++++++++++++++++++ lib/extensions/palettes.py | 112 ----------------------------------------- messages.po | 26 +++++++--- 6 files changed, 160 insertions(+), 137 deletions(-) create mode 100644 inx/inkstitch_install.inx delete mode 100644 inx/inkstitch_palettes.inx create mode 100644 lib/extensions/install.py delete mode 100644 lib/extensions/palettes.py (limited to 'inx') diff --git a/inx/inkstitch_install.inx b/inx/inkstitch_install.inx new file mode 100644 index 00000000..7275e13a --- /dev/null +++ b/inx/inkstitch_install.inx @@ -0,0 +1,17 @@ + + + <_name>Install add-ons for Inkscape + org.inkstitch.install + inkstitch.py + inkex.py + install + + all + + + + + + diff --git a/inx/inkstitch_palettes.inx b/inx/inkstitch_palettes.inx deleted file mode 100644 index 5daa3196..00000000 --- a/inx/inkstitch_palettes.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>Install thread manufacturer color palettes - org.inkstitch.palettes - inkstitch.py - inkex.py - palettes - - all - - - - - - diff --git a/lib/extensions/__init__.py b/lib/extensions/__init__.py index 6d3e00d8..b8951e12 100644 --- a/lib/extensions/__init__.py +++ b/lib/extensions/__init__.py @@ -1,5 +1,5 @@ from embroider import Embroider -from palettes import Palettes +from install import Install from params import Params from print_pdf import Print from simulate import Simulate diff --git a/lib/extensions/install.py b/lib/extensions/install.py new file mode 100644 index 00000000..5ce511e7 --- /dev/null +++ b/lib/extensions/install.py @@ -0,0 +1,123 @@ +# -*- coding: UTF-8 -*- + +import sys +import traceback +import os +from os.path import realpath, dirname +from glob import glob +from threading import Thread +import socket +import errno +import time +import logging +import wx +import inkex + +from ..utils import guess_inkscape_config_path + + +class InstallerFrame(wx.Frame): + def __init__(self, *args, **kwargs): + wx.Frame.__init__(self, *args, **kwargs) + + default_path = guess_inkscape_config_path() + + panel = wx.Panel(self) + sizer = wx.BoxSizer(wx.VERTICAL) + + text_sizer = wx.BoxSizer(wx.HORIZONTAL) + + text = _('Ink/Stitch can install files ("add-ons") that make it easier to use Inkscape to create machine embroidery designs. These add-ons will be installed:') + \ + "\n\n • " + _("thread manufacturer color palettes") + \ + "\n • " + _("Ink/Stitch visual commands (Object -> Symbols...)") + \ + "\n\n" + _("Directory in which to install add-ons:") + + static_text = wx.StaticText(panel, label=text) + font = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL) + static_text.SetFont(font) + text_sizer.Add(static_text, proportion=0, flag=wx.ALL|wx.EXPAND, border=10) + sizer.Add(text_sizer, proportion=3, flag=wx.ALL|wx.EXPAND, border=0) + + path_sizer = wx.BoxSizer(wx.HORIZONTAL) + self.path_input = wx.TextCtrl(panel, wx.ID_ANY, value=default_path) + path_sizer.Add(self.path_input, proportion=3, flag=wx.RIGHT, border=20) + chooser_button = wx.Button(panel, wx.ID_OPEN, _('Choose another directory...')) + path_sizer.Add(chooser_button, proportion=1, flag=0) + sizer.Add(path_sizer, proportion=1, flag=wx.ALL|wx.ALIGN_BOTTOM, border=10) + + buttons_sizer = wx.BoxSizer(wx.HORIZONTAL) + install_button = wx.Button(panel, wx.ID_ANY, _("Install")) + install_button.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK)) + buttons_sizer.Add(install_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) + cancel_button = wx.Button(panel, wx.ID_CANCEL, _("Cancel")) + buttons_sizer.Add(cancel_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) + sizer.Add(buttons_sizer, proportion=1, flag=wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM) + + #outer_sizer = wx.BoxSizer(wx.HORIZONTAL) + #outer_sizer.Add(sizer, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL) + + panel.SetSizer(sizer) + panel.Layout() + + chooser_button.Bind(wx.EVT_BUTTON, self.chooser_button_clicked) + cancel_button.Bind(wx.EVT_BUTTON, self.cancel_button_clicked) + install_button.Bind(wx.EVT_BUTTON, self.install_button_clicked) + + def cancel_button_clicked(self, event): + self.Destroy() + + def chooser_button_clicked(self, event): + dialog = wx.DirDialog(self, _("Choose Inkscape directory")) + if dialog.ShowModal() != wx.ID_CANCEL: + self.path_input.SetValue(dialog.GetPath()) + + def install_button_clicked(self, event): + try: + self.install_addons('palettes') + self.install_addons('symbols') + except Exception, e: + wx.MessageDialog(self, + _('Inkscape add-on installation failed') + ': \n' + traceback.format_exc(), + _('Installation Failed'), + wx.OK).ShowModal() + else: + wx.MessageDialog(self, + _('Inkscape add-on files have been installed. Please restart Inkscape to load the new add-ons.'), + _('Installation Completed'), + wx.OK).ShowModal() + + self.Destroy() + + def install_addons(self, type): + path = os.path.join(self.path_input.GetValue(), type) + src_dir = self.get_bundled_dir(type) + self.copy_files(glob(os.path.join(src_dir, "*")), path) + + def get_bundled_dir(self, name): + if getattr(sys, 'frozen', None) is not None: + return realpath(os.path.join(sys._MEIPASS, '..', name)) + else: + return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name)) + + if (sys.platform == "win32"): + # If we try to just use shutil.copy it says the operation requires elevation. + def copy_files(self, files, dest): + import winutils + + winutils.copy(files, dest) + else: + def copy_files(self, files, dest): + import shutil + + if not os.path.exists(dest): + os.makedirs(dest) + + for palette_file in files: + shutil.copy(palette_file, dest) + +class Install(inkex.Effect): + def effect(self): + app = wx.App() + installer_frame = InstallerFrame(None, title=_("Ink/Stitch Add-ons Installer"), size=(550, 350)) + installer_frame.Show() + app.MainLoop() diff --git a/lib/extensions/palettes.py b/lib/extensions/palettes.py deleted file mode 100644 index f7a6c7a5..00000000 --- a/lib/extensions/palettes.py +++ /dev/null @@ -1,112 +0,0 @@ -import sys -import traceback -import os -from os.path import realpath, dirname -from glob import glob -from threading import Thread -import socket -import errno -import time -import logging -import wx -import inkex - -from ..utils import guess_inkscape_config_path - - -class InstallPalettesFrame(wx.Frame): - def __init__(self, *args, **kwargs): - wx.Frame.__init__(self, *args, **kwargs) - - default_path = os.path.join(guess_inkscape_config_path(), "palettes") - - panel = wx.Panel(self) - sizer = wx.BoxSizer(wx.VERTICAL) - - text = wx.StaticText(panel, label=_("Directory in which to install palettes:")) - font = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL) - text.SetFont(font) - sizer.Add(text, proportion=0, flag=wx.ALL|wx.EXPAND, border=10) - - path_sizer = wx.BoxSizer(wx.HORIZONTAL) - self.path_input = wx.TextCtrl(panel, wx.ID_ANY, value=default_path) - path_sizer.Add(self.path_input, proportion=3, flag=wx.RIGHT|wx.EXPAND, border=20) - chooser_button = wx.Button(panel, wx.ID_OPEN, _('Choose another directory...')) - path_sizer.Add(chooser_button, proportion=1, flag=wx.EXPAND) - sizer.Add(path_sizer, proportion=0, flag=wx.ALL|wx.EXPAND, border=10) - - buttons_sizer = wx.BoxSizer(wx.HORIZONTAL) - install_button = wx.Button(panel, wx.ID_ANY, _("Install")) - install_button.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK)) - buttons_sizer.Add(install_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) - cancel_button = wx.Button(panel, wx.ID_CANCEL, _("Cancel")) - buttons_sizer.Add(cancel_button, proportion=0, flag=wx.ALIGN_RIGHT|wx.ALL, border=5) - sizer.Add(buttons_sizer, proportion=0, flag=wx.ALIGN_RIGHT) - - outer_sizer = wx.BoxSizer(wx.HORIZONTAL) - outer_sizer.Add(sizer, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL) - - panel.SetSizer(outer_sizer) - panel.Layout() - - chooser_button.Bind(wx.EVT_BUTTON, self.chooser_button_clicked) - cancel_button.Bind(wx.EVT_BUTTON, self.cancel_button_clicked) - install_button.Bind(wx.EVT_BUTTON, self.install_button_clicked) - - def cancel_button_clicked(self, event): - self.Destroy() - - def chooser_button_clicked(self, event): - dialog = wx.DirDialog(self, _("Choose Inkscape palettes directory")) - if dialog.ShowModal() != wx.ID_CANCEL: - self.path_input.SetValue(dialog.GetPath()) - - def install_button_clicked(self, event): - try: - self.install_palettes() - except Exception, e: - wx.MessageDialog(self, - _('Thread palette installation failed') + ': \n' + traceback.format_exc(), - _('Installation Failed'), - wx.OK).ShowModal() - else: - wx.MessageDialog(self, - _('Thread palette files have been installed. Please restart Inkscape to load the new palettes.'), - _('Installation Completed'), - wx.OK).ShowModal() - - self.Destroy() - - def install_palettes(self): - path = self.path_input.GetValue() - palettes_dir = self.get_bundled_palettes_dir() - self.copy_files(glob(os.path.join(palettes_dir, "*")), path) - - def get_bundled_palettes_dir(self): - if getattr(sys, 'frozen', None) is not None: - return realpath(os.path.join(sys._MEIPASS, '..', 'palettes')) - else: - return os.path.join(dirname(realpath(__file__)), 'palettes') - - if (sys.platform == "win32"): - # If we try to just use shutil.copy it says the operation requires elevation. - def copy_files(self, files, dest): - import winutils - - winutils.copy(files, dest) - else: - def copy_files(self, files, dest): - import shutil - - if not os.path.exists(dest): - os.makedirs(dest) - - for palette_file in files: - shutil.copy(palette_file, dest) - -class Palettes(inkex.Effect): - def effect(self): - app = wx.App() - installer_frame = InstallPalettesFrame(None, title=_("Ink/Stitch Thread Palette Installer"), size=(450, 200)) - installer_frame.Show() - app.MainLoop() diff --git a/messages.po b/messages.po index e6bfed43..89ce2de5 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-06-22 22:19-0400\n" +"POT-Creation-Date: 2018-06-24 15:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -198,7 +198,19 @@ msgid "" "Seeing a 'no such option' message? Please restart Inkscape to fix." msgstr "" -msgid "Directory in which to install palettes:" +msgid "" +"Ink/Stitch can install files (\"add-ons\") that make it easier to use " +"Inkscape to create machine embroidery designs. These add-ons will be " +"installed:" +msgstr "" + +msgid "thread manufacturer color palettes" +msgstr "" + +msgid "Ink/Stitch visual commands (Object -> Symbols...)" +msgstr "" + +msgid "Directory in which to install add-ons:" msgstr "" msgid "Choose another directory..." @@ -210,24 +222,24 @@ msgstr "" msgid "Cancel" msgstr "" -msgid "Choose Inkscape palettes directory" +msgid "Choose Inkscape directory" msgstr "" -msgid "Thread palette installation failed" +msgid "Inkscape add-on installation failed" msgstr "" msgid "Installation Failed" msgstr "" msgid "" -"Thread palette files have been installed. Please restart Inkscape to " -"load the new palettes." +"Inkscape add-on files have been installed. Please restart Inkscape to " +"load the new add-ons." msgstr "" msgid "Installation Completed" msgstr "" -msgid "Ink/Stitch Thread Palette Installer" +msgid "Ink/Stitch Add-ons Installer" msgstr "" msgid "These settings will be applied to 1 object." -- cgit v1.3.1 From 3299b7450f847e9ecb0df9f8b8a5cd3da755a33b Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 30 Jun 2018 13:02:33 -0400 Subject: add extension to swap satin column rails --- inx/inkstitch_flip.inx | 17 +++++++++++++++++ lib/extensions/__init__.py | 1 + lib/extensions/flip.py | 34 ++++++++++++++++++++++++++++++++++ messages.po | 5 ++++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 inx/inkstitch_flip.inx create mode 100644 lib/extensions/flip.py (limited to 'inx') diff --git a/inx/inkstitch_flip.inx b/inx/inkstitch_flip.inx new file mode 100644 index 00000000..f129b8d9 --- /dev/null +++ b/inx/inkstitch_flip.inx @@ -0,0 +1,17 @@ + + + <_name>Flip Satin Columns + org.inkstitch.flip_satins + inkstitch.py + inkex.py + flip + + all + + + + + + diff --git a/lib/extensions/__init__.py b/lib/extensions/__init__.py index b8951e12..b11ba1a4 100644 --- a/lib/extensions/__init__.py +++ b/lib/extensions/__init__.py @@ -6,3 +6,4 @@ from simulate import Simulate from input import Input from output import Output from zip import Zip +from flip import Flip diff --git a/lib/extensions/flip.py b/lib/extensions/flip.py new file mode 100644 index 00000000..75d8fe17 --- /dev/null +++ b/lib/extensions/flip.py @@ -0,0 +1,34 @@ +import sys +import inkex +import cubicsuperpath + +from .base import InkstitchExtension +from ..i18n import _ +from ..elements import SatinColumn + +class Flip(InkstitchExtension): + def flip(self, satin): + csp = cubicsuperpath.parsePath(satin.node.get("d")) + + if len(csp) > 1: + # find the rails (the two longest paths) and swap them + indices = range(len(csp)) + indices.sort(key=lambda i: len(csp[i]), reverse=True) + + first = indices[0] + second = indices[1] + csp[first], csp[second] = csp[second], csp[first] + + satin.node.set("d", cubicsuperpath.formatPath(csp)) + + def effect(self): + if not self.get_elements(): + return + + if not self.selected: + inkex.errormsg(_("Please select one or more satin columns to flip.")) + return + + for element in self.elements: + if isinstance(element, SatinColumn): + self.flip(element) diff --git a/messages.po b/messages.po index d6f156f2..72b60bb0 100644 --- a/messages.po +++ b/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2018-06-28 20:32-0400\n" +"POT-Creation-Date: 2018-06-30 13:02-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -198,6 +198,9 @@ msgid "" "Seeing a 'no such option' message? Please restart Inkscape to fix." msgstr "" +msgid "Please select one or more satin columns to flip." +msgstr "" + msgid "" "Ink/Stitch can install files (\"add-ons\") that make it easier to use " "Inkscape to create machine embroidery designs. These add-ons will be " -- cgit v1.3.1 From 3de394e14b00ac2653084f534149db418bd6cebd Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 4 Jul 2018 21:45:21 -0400 Subject: add new extension to attach commands to objects --- inx/inkstitch_commands.inx | 21 ++++++++ lib/extensions/__init__.py | 1 + lib/extensions/commands.py | 128 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 inx/inkstitch_commands.inx create mode 100644 lib/extensions/commands.py (limited to 'inx') diff --git a/inx/inkstitch_commands.inx b/inx/inkstitch_commands.inx new file mode 100644 index 00000000..7b42ca0e --- /dev/null +++ b/inx/inkstitch_commands.inx @@ -0,0 +1,21 @@ + + + <_name>Attach Commands + org.inkstitch.commands + inkstitch.py + inkex.py + false + false + false + false + commands + + all + + + + + + diff --git a/lib/extensions/__init__.py b/lib/extensions/__init__.py index b11ba1a4..dfdc7a3e 100644 --- a/lib/extensions/__init__.py +++ b/lib/extensions/__init__.py @@ -7,3 +7,4 @@ from input import Input from output import Output from zip import Zip from flip import Flip +from commands import * diff --git a/lib/extensions/commands.py b/lib/extensions/commands.py new file mode 100644 index 00000000..26ced110 --- /dev/null +++ b/lib/extensions/commands.py @@ -0,0 +1,128 @@ +import os +import sys +import inkex +import simpletransform +import cubicsuperpath +from copy import deepcopy +from shapely import geometry as shgeo + +from .base import InkstitchExtension +from ..i18n import _ +from ..elements import SatinColumn +from ..utils import get_bundled_dir, cache +from ..svg.tags import SVG_DEFS_TAG, SVG_GROUP_TAG, SVG_USE_TAG, SVG_PATH_TAG, INKSCAPE_GROUPMODE, XLINK_HREF, CONNECTION_START, CONNECTION_END, CONNECTOR_TYPE +from ..svg import get_node_transform + + +class Commands(InkstitchExtension): + COMMANDS = ["fill_start", "fill_end", "stop", "trim"] + + def __init__(self, *args, **kwargs): + InkstitchExtension.__init__(self, *args, **kwargs) + for command in self.COMMANDS: + self.OptionParser.add_option("--%s" % command, type="inkbool") + + @property + def symbols_path(self): + return os.path.join(get_bundled_dir("symbols"), "inkstitch.svg") + + @property + @cache + def symbols_svg(self): + with open(self.symbols_path) as symbols_file: + return inkex.etree.parse(symbols_file) + + @property + @cache + def symbol_defs(self): + return self.symbols_svg.find(SVG_DEFS_TAG) + + @property + @cache + def defs(self): + return self.document.find(SVG_DEFS_TAG) + + def ensure_symbol(self, command): + path = "./*[@id='inkstitch_%s']" % command + if self.defs.find(path) is None: + self.defs.append(deepcopy(self.symbol_defs.find(path))) + + def get_correction_transform(self, node): + # if we want to place our new nodes in the same group as this node, + # then we'll need to factor in the effects of any transforms set on + # the parents of this node. + + # we can ignore the transform on the node itself since it won't apply + # to the objects we add + transform = get_node_transform(node.getparent()) + + # now invert it, so that we can position our objects in absolute + # coordinates + transform = simpletransform.invertTransform(transform) + + return simpletransform.formatTransform(transform) + + def add_connector(self, symbol, element): + # I'd like it if I could position the connector endpoint nicely but inkscape just + # moves it to the element's center immediately after the extension runs. + start_pos = (symbol.get('x'), symbol.get('y')) + end_pos = element.shape.centroid + + path = inkex.etree.Element(SVG_PATH_TAG, + { + "id": self.uniqueId("connector"), + "d": "M %s,%s %s,%s" % (start_pos[0], start_pos[1], end_pos.x, end_pos.y), + "style": "stroke:#000000;stroke-width:1px;", + "transform": self.get_correction_transform(symbol), + CONNECTION_START: "#%s" % symbol.get('id'), + CONNECTION_END: "#%s" % element.node.get('id'), + CONNECTOR_TYPE: "polyline", + } + ) + + symbol.getparent().insert(symbol.getparent().index(symbol), path) + + def get_command_pos(self, element, index, total): + # Put command symbols 30 pixels out from the shape, spaced evenly around it. + outline = element.shape.buffer(30).exterior + return outline.interpolate(index / float(total), normalized=True) + + def add_command(self, element, commands): + for i, command in enumerate(commands): + pos = self.get_command_pos(element, i, len(commands)) + + symbol = inkex.etree.SubElement(element.node.getparent(), SVG_USE_TAG, + { + "id": self.uniqueId("use"), + XLINK_HREF: "#inkstitch_%s" % command, + "height": "100%", + "width": "100%", + "x": str(pos.x), + "y": str(pos.y), + "transform": self.get_correction_transform(element.node) + } + ) + + self.add_connector(symbol, element) + + def effect(self): + if not self.get_elements(): + return + + if not self.selected: + inkex.errormsg(_("Please select one or more objects to which to attach commands.")) + return + + self.svg = self.document.getroot() + + commands = [command for command in self.COMMANDS if getattr(self.options, command)] + + if not commands: + inkex.errormsg(_("Please choose one or more commands to attach.")) + return + + for command in commands: + self.ensure_symbol(command) + + for element in self.elements: + self.add_command(element, commands) -- cgit v1.3.1 From f85ee33af6fdb11bdd85af4e0832b9f2ef40b315 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 16 Jul 2018 19:49:32 -0400 Subject: update Embroider extension for pyembroidery --- bin/gen-output-format-option-list | 21 ++++++++------------- inx/inkstitch_embroider.inx | 31 ++++++++----------------------- 2 files changed, 16 insertions(+), 36 deletions(-) (limited to 'inx') diff --git a/bin/gen-output-format-option-list b/bin/gen-output-format-option-list index 674813bb..28a83976 100755 --- a/bin/gen-output-format-option-list +++ b/bin/gen-output-format-option-list @@ -1,19 +1,14 @@ #!/usr/bin/env python import sys +import pyembroidery -sys.path.append('embroidermodder/experimental/python/binding') -from libembroidery import * +formats = [format for format in pyembroidery.supported_formats() if 'writer' in format] +formats.sort(key=lambda format: (format['category'] != 'embroidery', format['extension'])) -formatList = embFormatList_create() -curFormat = formatList -while(curFormat): - extension = embFormat_extension(curFormat) - description = embFormat_description(curFormat) - writerState = embFormat_writerState(curFormat) - - if writerState.strip() and embFormat_type(curFormat) != EMBFORMAT_OBJECTONLY: - print '<_option value="%s">%s(%s)' % (extension[1:], description, extension.upper()) - - curFormat = curFormat.next +for format in formats: + tag = "" + if format['category'] != 'embroidery': + tag = " [DEBUG]" + print '<_option value="%s">%s(%s)%s' % (format['extension'], format['description'], format['extension'].upper(), tag) diff --git a/inx/inkstitch_embroider.inx b/inx/inkstitch_embroider.inx index 1f5619a3..2c988a51 100644 --- a/inx/inkstitch_embroider.inx +++ b/inx/inkstitch_embroider.inx @@ -7,29 +7,14 @@ _gui-description="Jump stitches smaller than this will be treated as normal stitches.">3.0 true - <_option value="csv">Comma Separated Values Format(.CSV) - <_option value="col">Embroidery Thread Color Format(.COL) - <_option value="dst">Tajima Embroidery Format(.DST) - <_option value="edr">Embird Embroidery Format(.EDR) - <_option value="exp">Melco Embroidery Format(.EXP) - <_option value="hus">Husqvarna Viking Embroidery Format(.HUS) - <_option value="inf">Embroidery Color Format(.INF) - <_option value="jef">Janome Embroidery Format(.JEF) - <_option value="ksm">Pfaff Embroidery Format(.KSM) - <_option value="max">Pfaff Embroidery Format(.MAX) - <_option value="pcd">Pfaff Embroidery Format(.PCD) - <_option value="pcq">Pfaff Embroidery Format(.PCQ) - <_option value="pcs">Pfaff Embroidery Format(.PCS) - <_option value="pec">Brother Embroidery Format(.PEC) - <_option value="pes">Brother Embroidery Format(.PES) - <_option value="plt">AutoCAD Plot Drawing Format(.PLT) - <_option value="rgb">RGB Embroidery Format(.RGB) - <_option value="sew">Janome Embroidery Format(.SEW) - <_option value="tap">Happy Embroidery Format(.TAP) - <_option value="thr">ThredWorks Embroidery Format(.THR) - <_option value="txt">Text File(.TXT) - <_option value="vp3">Pfaff Embroidery Format(.VP3) - <_option value="xxx">Singer Embroidery Format(.XXX) + <_option value="dst">Tajima Embroidery Format(DST) + <_option value="exp">Melco Embroidery Format(EXP) + <_option value="jef">Janome Embroidery Format(JEF) + <_option value="pec">Brother Embroidery Format(PEC) + <_option value="pes">Brother Embroidery Format(PES) + <_option value="vp3">Pfaff Embroidery Format(VP3) + <_option value="csv">Comma-separated values(CSV) [DEBUG] + <_option value="svg">Scalable Vector Graphics(SVG) [DEBUG] embroider -- cgit v1.3.1 From 17a9f23bfb8b3a150092bc499cdaf533e3390719 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 17 Jul 2018 20:14:23 -0400 Subject: update input extension generator and INXes --- bin/gen-input-inx | 23 +++++++---------------- inx/inkstitch_input_COL.inx | 17 ----------------- inx/inkstitch_input_CSD.inx | 17 ----------------- inx/inkstitch_input_CSV.inx | 17 ----------------- inx/inkstitch_input_DAT.inx | 17 ----------------- inx/inkstitch_input_DSB.inx | 2 +- inx/inkstitch_input_EDR.inx | 17 ----------------- inx/inkstitch_input_EXY.inx | 17 ----------------- inx/inkstitch_input_FXY.inx | 17 ----------------- inx/inkstitch_input_GT.inx | 17 ----------------- inx/inkstitch_input_HUS.inx | 17 ----------------- inx/inkstitch_input_INF.inx | 17 ----------------- inx/inkstitch_input_MAX.inx | 17 ----------------- inx/inkstitch_input_MIT.inx | 17 ----------------- inx/inkstitch_input_NEW.inx | 17 ----------------- inx/inkstitch_input_OFM.inx | 17 ----------------- inx/inkstitch_input_PCD.inx | 17 ----------------- inx/inkstitch_input_PCM.inx | 17 ----------------- inx/inkstitch_input_PCQ.inx | 17 ----------------- inx/inkstitch_input_PCS.inx | 17 ----------------- inx/inkstitch_input_PHB.inx | 17 ----------------- inx/inkstitch_input_PHC.inx | 17 ----------------- inx/inkstitch_input_PLT.inx | 17 ----------------- inx/inkstitch_input_RGB.inx | 17 ----------------- inx/inkstitch_input_SST.inx | 17 ----------------- inx/inkstitch_input_T09.inx | 17 ----------------- inx/inkstitch_input_TBF.inx | 17 +++++++++++++++++ inx/inkstitch_input_THR.inx | 17 ----------------- inx/inkstitch_input_U00.inx | 17 ----------------- inx/inkstitch_input_U01.inx | 17 +++++++++++++++++ inx/inkstitch_input_VIP.inx | 17 ----------------- inx/inkstitch_input_ZSK.inx | 17 ----------------- 32 files changed, 42 insertions(+), 493 deletions(-) delete mode 100644 inx/inkstitch_input_COL.inx delete mode 100644 inx/inkstitch_input_CSD.inx delete mode 100644 inx/inkstitch_input_CSV.inx delete mode 100644 inx/inkstitch_input_DAT.inx delete mode 100644 inx/inkstitch_input_EDR.inx delete mode 100644 inx/inkstitch_input_EXY.inx delete mode 100644 inx/inkstitch_input_FXY.inx delete mode 100644 inx/inkstitch_input_GT.inx delete mode 100644 inx/inkstitch_input_HUS.inx delete mode 100644 inx/inkstitch_input_INF.inx delete mode 100644 inx/inkstitch_input_MAX.inx delete mode 100644 inx/inkstitch_input_MIT.inx delete mode 100644 inx/inkstitch_input_NEW.inx delete mode 100644 inx/inkstitch_input_OFM.inx delete mode 100644 inx/inkstitch_input_PCD.inx delete mode 100644 inx/inkstitch_input_PCM.inx delete mode 100644 inx/inkstitch_input_PCQ.inx delete mode 100644 inx/inkstitch_input_PCS.inx delete mode 100644 inx/inkstitch_input_PHB.inx delete mode 100644 inx/inkstitch_input_PHC.inx delete mode 100644 inx/inkstitch_input_PLT.inx delete mode 100644 inx/inkstitch_input_RGB.inx delete mode 100644 inx/inkstitch_input_SST.inx delete mode 100644 inx/inkstitch_input_T09.inx create mode 100644 inx/inkstitch_input_TBF.inx delete mode 100644 inx/inkstitch_input_THR.inx delete mode 100644 inx/inkstitch_input_U00.inx create mode 100644 inx/inkstitch_input_U01.inx delete mode 100644 inx/inkstitch_input_VIP.inx delete mode 100644 inx/inkstitch_input_ZSK.inx (limited to 'inx') diff --git a/bin/gen-input-inx b/bin/gen-input-inx index 6351d062..ae32b43f 100755 --- a/bin/gen-input-inx +++ b/bin/gen-input-inx @@ -2,7 +2,7 @@ import sys, os from os.path import dirname -from libembroidery import * +import pyembroidery from jinja2 import Environment, FileSystemLoader, select_autoescape @@ -15,30 +15,21 @@ def build_environment(): ) -def libembroidery_input_formats(): - formatList = embFormatList_create() - curFormat = formatList - while(curFormat): - extension = embFormat_extension(curFormat) - description = embFormat_description(curFormat) - reader_state = embFormat_readerState(curFormat) - - if reader_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 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 libembroidery_input_formats(): + 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: - inx_file.write(inx) + print >> inx_file, inx if __name__ == "__main__": diff --git a/inx/inkstitch_input_COL.inx b/inx/inkstitch_input_COL.inx deleted file mode 100644 index 38ebe7bd..00000000 --- a/inx/inkstitch_input_COL.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>COL file input - org.inkstitch.input.col - inkstitch.py - inkex.py - - .col - application/x-embroidery-col - <_filetypename>Ink/Stitch: Embroidery Thread Color Format (.col) - <_filetypetooltip>convert COL file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_CSD.inx b/inx/inkstitch_input_CSD.inx deleted file mode 100644 index 444270f0..00000000 --- a/inx/inkstitch_input_CSD.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>CSD file input - org.inkstitch.input.csd - inkstitch.py - inkex.py - - .csd - application/x-embroidery-csd - <_filetypename>Ink/Stitch: Singer Embroidery Format (.csd) - <_filetypetooltip>convert CSD file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_CSV.inx b/inx/inkstitch_input_CSV.inx deleted file mode 100644 index 0c3e2096..00000000 --- a/inx/inkstitch_input_CSV.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>CSV file input - org.inkstitch.input.csv - inkstitch.py - inkex.py - - .csv - application/x-embroidery-csv - <_filetypename>Ink/Stitch: Comma Separated Values Format (.csv) - <_filetypetooltip>convert CSV file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_DAT.inx b/inx/inkstitch_input_DAT.inx deleted file mode 100644 index e82694b8..00000000 --- a/inx/inkstitch_input_DAT.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>DAT file input - org.inkstitch.input.dat - inkstitch.py - inkex.py - - .dat - application/x-embroidery-dat - <_filetypename>Ink/Stitch: Barudan Embroidery Format (.dat) - <_filetypetooltip>convert DAT file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_DSB.inx b/inx/inkstitch_input_DSB.inx index 8b7c6b02..c78e1c2d 100644 --- a/inx/inkstitch_input_DSB.inx +++ b/inx/inkstitch_input_DSB.inx @@ -7,7 +7,7 @@ .dsb application/x-embroidery-dsb - <_filetypename>Ink/Stitch: Barudan Embroidery Format (.dsb) + <_filetypename>Ink/Stitch: Tajima(Barudan) Embroidery Format (.dsb) <_filetypetooltip>convert DSB file to Ink/Stitch manual-stitch paths input diff --git a/inx/inkstitch_input_EDR.inx b/inx/inkstitch_input_EDR.inx deleted file mode 100644 index 92cf7d14..00000000 --- a/inx/inkstitch_input_EDR.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>EDR file input - org.inkstitch.input.edr - inkstitch.py - inkex.py - - .edr - application/x-embroidery-edr - <_filetypename>Ink/Stitch: Embird Embroidery Format (.edr) - <_filetypetooltip>convert EDR file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_EXY.inx b/inx/inkstitch_input_EXY.inx deleted file mode 100644 index 78de68d8..00000000 --- a/inx/inkstitch_input_EXY.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>EXY file input - org.inkstitch.input.exy - inkstitch.py - inkex.py - - .exy - application/x-embroidery-exy - <_filetypename>Ink/Stitch: Eltac Embroidery Format (.exy) - <_filetypetooltip>convert EXY file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_FXY.inx b/inx/inkstitch_input_FXY.inx deleted file mode 100644 index c2be8c60..00000000 --- a/inx/inkstitch_input_FXY.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>FXY file input - org.inkstitch.input.fxy - inkstitch.py - inkex.py - - .fxy - application/x-embroidery-fxy - <_filetypename>Ink/Stitch: Fortron Embroidery Format (.fxy) - <_filetypetooltip>convert FXY file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_GT.inx b/inx/inkstitch_input_GT.inx deleted file mode 100644 index 20a9fda0..00000000 --- a/inx/inkstitch_input_GT.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>GT file input - org.inkstitch.input.gt - inkstitch.py - inkex.py - - .gt - application/x-embroidery-gt - <_filetypename>Ink/Stitch: Gold Thread Embroidery Format (.gt) - <_filetypetooltip>convert GT file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_HUS.inx b/inx/inkstitch_input_HUS.inx deleted file mode 100644 index bbac96a2..00000000 --- a/inx/inkstitch_input_HUS.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>HUS file input - org.inkstitch.input.hus - inkstitch.py - inkex.py - - .hus - application/x-embroidery-hus - <_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.hus) - <_filetypetooltip>convert HUS file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_INF.inx b/inx/inkstitch_input_INF.inx deleted file mode 100644 index 9c07ed7f..00000000 --- a/inx/inkstitch_input_INF.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>INF file input - org.inkstitch.input.inf - inkstitch.py - inkex.py - - .inf - application/x-embroidery-inf - <_filetypename>Ink/Stitch: Embroidery Color Format (.inf) - <_filetypetooltip>convert INF file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_MAX.inx b/inx/inkstitch_input_MAX.inx deleted file mode 100644 index 0f5ed952..00000000 --- a/inx/inkstitch_input_MAX.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>MAX file input - org.inkstitch.input.max - inkstitch.py - inkex.py - - .max - application/x-embroidery-max - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.max) - <_filetypetooltip>convert MAX file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_MIT.inx b/inx/inkstitch_input_MIT.inx deleted file mode 100644 index a0181182..00000000 --- a/inx/inkstitch_input_MIT.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>MIT file input - org.inkstitch.input.mit - inkstitch.py - inkex.py - - .mit - application/x-embroidery-mit - <_filetypename>Ink/Stitch: Mitsubishi Embroidery Format (.mit) - <_filetypetooltip>convert MIT file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_NEW.inx b/inx/inkstitch_input_NEW.inx deleted file mode 100644 index 15d877d8..00000000 --- a/inx/inkstitch_input_NEW.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>NEW file input - org.inkstitch.input.new - inkstitch.py - inkex.py - - .new - application/x-embroidery-new - <_filetypename>Ink/Stitch: Ameco Embroidery Format (.new) - <_filetypetooltip>convert NEW file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_OFM.inx b/inx/inkstitch_input_OFM.inx deleted file mode 100644 index 3e162355..00000000 --- a/inx/inkstitch_input_OFM.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>OFM file input - org.inkstitch.input.ofm - inkstitch.py - inkex.py - - .ofm - application/x-embroidery-ofm - <_filetypename>Ink/Stitch: Melco Embroidery Format (.ofm) - <_filetypetooltip>convert OFM file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PCD.inx b/inx/inkstitch_input_PCD.inx deleted file mode 100644 index eff3c2f7..00000000 --- a/inx/inkstitch_input_PCD.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PCD file input - org.inkstitch.input.pcd - inkstitch.py - inkex.py - - .pcd - application/x-embroidery-pcd - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcd) - <_filetypetooltip>convert PCD file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PCM.inx b/inx/inkstitch_input_PCM.inx deleted file mode 100644 index 684b7e20..00000000 --- a/inx/inkstitch_input_PCM.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PCM file input - org.inkstitch.input.pcm - inkstitch.py - inkex.py - - .pcm - application/x-embroidery-pcm - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcm) - <_filetypetooltip>convert PCM file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PCQ.inx b/inx/inkstitch_input_PCQ.inx deleted file mode 100644 index 44d2d6df..00000000 --- a/inx/inkstitch_input_PCQ.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PCQ file input - org.inkstitch.input.pcq - inkstitch.py - inkex.py - - .pcq - application/x-embroidery-pcq - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcq) - <_filetypetooltip>convert PCQ file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PCS.inx b/inx/inkstitch_input_PCS.inx deleted file mode 100644 index 1a030e53..00000000 --- a/inx/inkstitch_input_PCS.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PCS file input - org.inkstitch.input.pcs - inkstitch.py - inkex.py - - .pcs - application/x-embroidery-pcs - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcs) - <_filetypetooltip>convert PCS file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PHB.inx b/inx/inkstitch_input_PHB.inx deleted file mode 100644 index 0e14f097..00000000 --- a/inx/inkstitch_input_PHB.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PHB file input - org.inkstitch.input.phb - inkstitch.py - inkex.py - - .phb - application/x-embroidery-phb - <_filetypename>Ink/Stitch: Brother Embroidery Format (.phb) - <_filetypetooltip>convert PHB file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PHC.inx b/inx/inkstitch_input_PHC.inx deleted file mode 100644 index 3c2d10f5..00000000 --- a/inx/inkstitch_input_PHC.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PHC file input - org.inkstitch.input.phc - inkstitch.py - inkex.py - - .phc - application/x-embroidery-phc - <_filetypename>Ink/Stitch: Brother Embroidery Format (.phc) - <_filetypetooltip>convert PHC file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_PLT.inx b/inx/inkstitch_input_PLT.inx deleted file mode 100644 index d811ff02..00000000 --- a/inx/inkstitch_input_PLT.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>PLT file input - org.inkstitch.input.plt - inkstitch.py - inkex.py - - .plt - application/x-embroidery-plt - <_filetypename>Ink/Stitch: AutoCAD Plot Drawing Format (.plt) - <_filetypetooltip>convert PLT file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_RGB.inx b/inx/inkstitch_input_RGB.inx deleted file mode 100644 index b64e285b..00000000 --- a/inx/inkstitch_input_RGB.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>RGB file input - org.inkstitch.input.rgb - inkstitch.py - inkex.py - - .rgb - application/x-embroidery-rgb - <_filetypename>Ink/Stitch: RGB Embroidery Format (.rgb) - <_filetypetooltip>convert RGB file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_SST.inx b/inx/inkstitch_input_SST.inx deleted file mode 100644 index 85533659..00000000 --- a/inx/inkstitch_input_SST.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>SST file input - org.inkstitch.input.sst - inkstitch.py - inkex.py - - .sst - application/x-embroidery-sst - <_filetypename>Ink/Stitch: Sunstar Embroidery Format (.sst) - <_filetypetooltip>convert SST file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_T09.inx b/inx/inkstitch_input_T09.inx deleted file mode 100644 index eb6ab6d9..00000000 --- a/inx/inkstitch_input_T09.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>T09 file input - org.inkstitch.input.t09 - inkstitch.py - inkex.py - - .t09 - application/x-embroidery-t09 - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.t09) - <_filetypetooltip>convert T09 file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_TBF.inx b/inx/inkstitch_input_TBF.inx new file mode 100644 index 00000000..e2b72ec9 --- /dev/null +++ b/inx/inkstitch_input_TBF.inx @@ -0,0 +1,17 @@ + + + <_name>TBF file input + org.inkstitch.input.tbf + inkstitch.py + inkex.py + + .tbf + application/x-embroidery-tbf + <_filetypename>Ink/Stitch: Tajima Embroidery Format (.tbf) + <_filetypetooltip>convert TBF file to Ink/Stitch manual-stitch paths + + input + + diff --git a/inx/inkstitch_input_THR.inx b/inx/inkstitch_input_THR.inx deleted file mode 100644 index e6a6e09e..00000000 --- a/inx/inkstitch_input_THR.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>THR file input - org.inkstitch.input.thr - inkstitch.py - inkex.py - - .thr - application/x-embroidery-thr - <_filetypename>Ink/Stitch: ThredWorks Embroidery Format (.thr) - <_filetypetooltip>convert THR file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_U00.inx b/inx/inkstitch_input_U00.inx deleted file mode 100644 index b28da66d..00000000 --- a/inx/inkstitch_input_U00.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>U00 file input - org.inkstitch.input.u00 - inkstitch.py - inkex.py - - .u00 - application/x-embroidery-u00 - <_filetypename>Ink/Stitch: Barudan Embroidery Format (.u00) - <_filetypetooltip>convert U00 file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_U01.inx b/inx/inkstitch_input_U01.inx new file mode 100644 index 00000000..befadd5b --- /dev/null +++ b/inx/inkstitch_input_U01.inx @@ -0,0 +1,17 @@ + + + <_name>U01 file input + org.inkstitch.input.u01 + inkstitch.py + inkex.py + + .u01 + application/x-embroidery-u01 + <_filetypename>Ink/Stitch: Barudan Embroidery Format (.u01) + <_filetypetooltip>convert U01 file to Ink/Stitch manual-stitch paths + + input + + diff --git a/inx/inkstitch_input_VIP.inx b/inx/inkstitch_input_VIP.inx deleted file mode 100644 index 3723285c..00000000 --- a/inx/inkstitch_input_VIP.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>VIP file input - org.inkstitch.input.vip - inkstitch.py - inkex.py - - .vip - application/x-embroidery-vip - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.vip) - <_filetypetooltip>convert VIP file to Ink/Stitch manual-stitch paths - - input - - diff --git a/inx/inkstitch_input_ZSK.inx b/inx/inkstitch_input_ZSK.inx deleted file mode 100644 index 4178126f..00000000 --- a/inx/inkstitch_input_ZSK.inx +++ /dev/null @@ -1,17 +0,0 @@ - - - <_name>ZSK file input - org.inkstitch.input.zsk - inkstitch.py - inkex.py - - .zsk - application/x-embroidery-zsk - <_filetypename>Ink/Stitch: ZSK USA Embroidery Format (.zsk) - <_filetypetooltip>convert ZSK file to Ink/Stitch manual-stitch paths - - input - - -- cgit v1.3.1 From c061b3a66aaf1f404440e3aa511b8655dd5b1592 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 17 Jul 2018 20:17:48 -0400 Subject: update output extension generator and INXes --- bin/gen-output-inx | 23 +++++++---------------- inx/inkstitch_output_COL.inx | 19 ------------------- inx/inkstitch_output_CSV.inx | 19 ------------------- inx/inkstitch_output_DST.inx | 2 +- inx/inkstitch_output_EDR.inx | 19 ------------------- inx/inkstitch_output_EXP.inx | 2 +- inx/inkstitch_output_HUS.inx | 19 ------------------- inx/inkstitch_output_INF.inx | 19 ------------------- inx/inkstitch_output_JEF.inx | 2 +- inx/inkstitch_output_KSM.inx | 19 ------------------- inx/inkstitch_output_MAX.inx | 19 ------------------- inx/inkstitch_output_PCD.inx | 19 ------------------- inx/inkstitch_output_PCQ.inx | 19 ------------------- inx/inkstitch_output_PCS.inx | 19 ------------------- inx/inkstitch_output_PEC.inx | 2 +- inx/inkstitch_output_PES.inx | 2 +- inx/inkstitch_output_PLT.inx | 19 ------------------- inx/inkstitch_output_RGB.inx | 19 ------------------- inx/inkstitch_output_THR.inx | 19 ------------------- inx/inkstitch_output_TXT.inx | 19 ------------------- inx/inkstitch_output_VP3.inx | 2 +- inx/inkstitch_output_XXX.inx | 19 ------------------- 22 files changed, 13 insertions(+), 307 deletions(-) delete mode 100644 inx/inkstitch_output_COL.inx delete mode 100644 inx/inkstitch_output_CSV.inx delete mode 100644 inx/inkstitch_output_EDR.inx delete mode 100644 inx/inkstitch_output_HUS.inx delete mode 100644 inx/inkstitch_output_INF.inx delete mode 100644 inx/inkstitch_output_KSM.inx delete mode 100644 inx/inkstitch_output_MAX.inx delete mode 100644 inx/inkstitch_output_PCD.inx delete mode 100644 inx/inkstitch_output_PCQ.inx delete mode 100644 inx/inkstitch_output_PCS.inx delete mode 100644 inx/inkstitch_output_PLT.inx delete mode 100644 inx/inkstitch_output_RGB.inx delete mode 100644 inx/inkstitch_output_THR.inx delete mode 100644 inx/inkstitch_output_TXT.inx delete mode 100644 inx/inkstitch_output_XXX.inx (limited to 'inx') diff --git a/bin/gen-output-inx b/bin/gen-output-inx index f167dbee..fbe2ad55 100755 --- a/bin/gen-output-inx +++ b/bin/gen-output-inx @@ -2,7 +2,7 @@ import sys, os from os.path import dirname -from libembroidery import * +import pyembroidery from jinja2 import Environment, FileSystemLoader, select_autoescape @@ -15,30 +15,21 @@ def build_environment(): ) -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 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 libembroidery_output_formats(): + 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: - inx_file.write(inx) + print >> inx_file, inx if __name__ == "__main__": diff --git a/inx/inkstitch_output_COL.inx b/inx/inkstitch_output_COL.inx deleted file mode 100644 index 8a240a38..00000000 --- a/inx/inkstitch_output_COL.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>COL file output - org.inkstitch.output.col - inkstitch.py - inkex.py - - .col - application/x-embroidery-col - <_filetypename>Ink/Stitch: Embroidery Thread Color Format (.col) - <_filetypetooltip>Save design in COL format using Ink/Stitch - true - - output - col - - \ No newline at end of file diff --git a/inx/inkstitch_output_CSV.inx b/inx/inkstitch_output_CSV.inx deleted file mode 100644 index d2f340cd..00000000 --- a/inx/inkstitch_output_CSV.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>CSV file output - org.inkstitch.output.csv - inkstitch.py - inkex.py - - .csv - application/x-embroidery-csv - <_filetypename>Ink/Stitch: Comma Separated Values Format (.csv) - <_filetypetooltip>Save design in CSV format using Ink/Stitch - true - - output - csv - - \ No newline at end of file diff --git a/inx/inkstitch_output_DST.inx b/inx/inkstitch_output_DST.inx index 2230600a..fa034f40 100644 --- a/inx/inkstitch_output_DST.inx +++ b/inx/inkstitch_output_DST.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_EDR.inx b/inx/inkstitch_output_EDR.inx deleted file mode 100644 index 0756b37a..00000000 --- a/inx/inkstitch_output_EDR.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>EDR file output - org.inkstitch.output.edr - inkstitch.py - inkex.py - - .edr - application/x-embroidery-edr - <_filetypename>Ink/Stitch: Embird Embroidery Format (.edr) - <_filetypetooltip>Save design in EDR format using Ink/Stitch - true - - output - edr - - \ No newline at end of file diff --git a/inx/inkstitch_output_EXP.inx b/inx/inkstitch_output_EXP.inx index ce98dbc0..853bab9f 100644 --- a/inx/inkstitch_output_EXP.inx +++ b/inx/inkstitch_output_EXP.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_HUS.inx b/inx/inkstitch_output_HUS.inx deleted file mode 100644 index 44536f2a..00000000 --- a/inx/inkstitch_output_HUS.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>HUS file output - org.inkstitch.output.hus - inkstitch.py - inkex.py - - .hus - application/x-embroidery-hus - <_filetypename>Ink/Stitch: Husqvarna Viking Embroidery Format (.hus) - <_filetypetooltip>Save design in HUS format using Ink/Stitch - true - - output - hus - - \ No newline at end of file diff --git a/inx/inkstitch_output_INF.inx b/inx/inkstitch_output_INF.inx deleted file mode 100644 index 47c2b63e..00000000 --- a/inx/inkstitch_output_INF.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>INF file output - org.inkstitch.output.inf - inkstitch.py - inkex.py - - .inf - application/x-embroidery-inf - <_filetypename>Ink/Stitch: Embroidery Color Format (.inf) - <_filetypetooltip>Save design in INF format using Ink/Stitch - true - - output - inf - - \ No newline at end of file diff --git a/inx/inkstitch_output_JEF.inx b/inx/inkstitch_output_JEF.inx index af92a836..74b752fc 100644 --- a/inx/inkstitch_output_JEF.inx +++ b/inx/inkstitch_output_JEF.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_KSM.inx b/inx/inkstitch_output_KSM.inx deleted file mode 100644 index ad5ae4dd..00000000 --- a/inx/inkstitch_output_KSM.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>KSM file output - org.inkstitch.output.ksm - inkstitch.py - inkex.py - - .ksm - application/x-embroidery-ksm - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.ksm) - <_filetypetooltip>Save design in KSM format using Ink/Stitch - true - - output - ksm - - \ No newline at end of file diff --git a/inx/inkstitch_output_MAX.inx b/inx/inkstitch_output_MAX.inx deleted file mode 100644 index 45a5ba01..00000000 --- a/inx/inkstitch_output_MAX.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>MAX file output - org.inkstitch.output.max - inkstitch.py - inkex.py - - .max - application/x-embroidery-max - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.max) - <_filetypetooltip>Save design in MAX format using Ink/Stitch - true - - output - max - - \ No newline at end of file diff --git a/inx/inkstitch_output_PCD.inx b/inx/inkstitch_output_PCD.inx deleted file mode 100644 index b42f79de..00000000 --- a/inx/inkstitch_output_PCD.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>PCD file output - org.inkstitch.output.pcd - inkstitch.py - inkex.py - - .pcd - application/x-embroidery-pcd - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcd) - <_filetypetooltip>Save design in PCD format using Ink/Stitch - true - - output - pcd - - \ No newline at end of file diff --git a/inx/inkstitch_output_PCQ.inx b/inx/inkstitch_output_PCQ.inx deleted file mode 100644 index 1764f670..00000000 --- a/inx/inkstitch_output_PCQ.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>PCQ file output - org.inkstitch.output.pcq - inkstitch.py - inkex.py - - .pcq - application/x-embroidery-pcq - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcq) - <_filetypetooltip>Save design in PCQ format using Ink/Stitch - true - - output - pcq - - \ No newline at end of file diff --git a/inx/inkstitch_output_PCS.inx b/inx/inkstitch_output_PCS.inx deleted file mode 100644 index ef07c4bd..00000000 --- a/inx/inkstitch_output_PCS.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>PCS file output - org.inkstitch.output.pcs - inkstitch.py - inkex.py - - .pcs - application/x-embroidery-pcs - <_filetypename>Ink/Stitch: Pfaff Embroidery Format (.pcs) - <_filetypetooltip>Save design in PCS format using Ink/Stitch - true - - output - pcs - - \ No newline at end of file diff --git a/inx/inkstitch_output_PEC.inx b/inx/inkstitch_output_PEC.inx index 15880ce6..6d76b165 100644 --- a/inx/inkstitch_output_PEC.inx +++ b/inx/inkstitch_output_PEC.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_PES.inx b/inx/inkstitch_output_PES.inx index cd7e7369..b821225a 100644 --- a/inx/inkstitch_output_PES.inx +++ b/inx/inkstitch_output_PES.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_PLT.inx b/inx/inkstitch_output_PLT.inx deleted file mode 100644 index 649ef76b..00000000 --- a/inx/inkstitch_output_PLT.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>PLT file output - org.inkstitch.output.plt - inkstitch.py - inkex.py - - .plt - application/x-embroidery-plt - <_filetypename>Ink/Stitch: AutoCAD Plot Drawing Format (.plt) - <_filetypetooltip>Save design in PLT format using Ink/Stitch - true - - output - plt - - \ No newline at end of file diff --git a/inx/inkstitch_output_RGB.inx b/inx/inkstitch_output_RGB.inx deleted file mode 100644 index e60d729e..00000000 --- a/inx/inkstitch_output_RGB.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>RGB file output - org.inkstitch.output.rgb - inkstitch.py - inkex.py - - .rgb - application/x-embroidery-rgb - <_filetypename>Ink/Stitch: RGB Embroidery Format (.rgb) - <_filetypetooltip>Save design in RGB format using Ink/Stitch - true - - output - rgb - - \ No newline at end of file diff --git a/inx/inkstitch_output_THR.inx b/inx/inkstitch_output_THR.inx deleted file mode 100644 index c460bdfc..00000000 --- a/inx/inkstitch_output_THR.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>THR file output - org.inkstitch.output.thr - inkstitch.py - inkex.py - - .thr - application/x-embroidery-thr - <_filetypename>Ink/Stitch: ThredWorks Embroidery Format (.thr) - <_filetypetooltip>Save design in THR format using Ink/Stitch - true - - output - thr - - \ No newline at end of file diff --git a/inx/inkstitch_output_TXT.inx b/inx/inkstitch_output_TXT.inx deleted file mode 100644 index 805deffe..00000000 --- a/inx/inkstitch_output_TXT.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>TXT file output - org.inkstitch.output.txt - inkstitch.py - inkex.py - - .txt - application/x-embroidery-txt - <_filetypename>Ink/Stitch: Text File (.txt) - <_filetypetooltip>Save design in TXT format using Ink/Stitch - true - - output - txt - - \ No newline at end of file diff --git a/inx/inkstitch_output_VP3.inx b/inx/inkstitch_output_VP3.inx index dff29de4..11843420 100644 --- a/inx/inkstitch_output_VP3.inx +++ b/inx/inkstitch_output_VP3.inx @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/inx/inkstitch_output_XXX.inx b/inx/inkstitch_output_XXX.inx deleted file mode 100644 index ad4135b0..00000000 --- a/inx/inkstitch_output_XXX.inx +++ /dev/null @@ -1,19 +0,0 @@ - - - <_name>XXX file output - org.inkstitch.output.xxx - inkstitch.py - inkex.py - - .xxx - application/x-embroidery-xxx - <_filetypename>Ink/Stitch: Singer Embroidery Format (.xxx) - <_filetypetooltip>Save design in XXX format using Ink/Stitch - true - - output - xxx - - \ No newline at end of file -- cgit v1.3.1 From d189f88050df2db19226f50c80b0304c7bd1bd28 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 17 Jul 2018 20:19:17 -0400 Subject: update zip output generator and INX --- bin/gen-zip-inx | 21 ++++++--------------- inx/inkstitch_output_ZIP.inx | 38 ++++---------------------------------- 2 files changed, 10 insertions(+), 49 deletions(-) (limited to 'inx') diff --git a/bin/gen-zip-inx b/bin/gen-zip-inx index 5fbc8f1e..40948786 100755 --- a/bin/gen-zip-inx +++ b/bin/gen-zip-inx @@ -2,7 +2,7 @@ import sys, os from os.path import dirname -from libembroidery import * +import pyembroidery from jinja2 import Environment, FileSystemLoader, select_autoescape @@ -15,26 +15,17 @@ def build_environment(): ) -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 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=libembroidery_output_formats()) + inx = template.render(formats=pyembroidery_output_formats()) with open("inx/inkstitch_output_ZIP.inx", 'w') as inx_file: inx_file.write(inx) diff --git a/inx/inkstitch_output_ZIP.inx b/inx/inkstitch_output_ZIP.inx index b5b2cf1c..81f17b23 100644 --- a/inx/inkstitch_output_ZIP.inx +++ b/inx/inkstitch_output_ZIP.inx @@ -12,50 +12,20 @@ true - false - - false - - false - - false - - false - - false - - false - - false - - false - - false - - false - - false - - false - false false - false - - false + false - false + false - false + false false - false - zip - + \ No newline at end of file -- cgit v1.3.1