From 17a9f23bfb8b3a150092bc499cdaf533e3390719 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 17 Jul 2018 20:14:23 -0400 Subject: [PATCH] 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_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 -------------- ..._input_EDR.inx => inkstitch_input_TBF.inx} | 12 +++++----- inx/inkstitch_input_THR.inx | 17 -------------- ..._input_U00.inx => inkstitch_input_U01.inx} | 12 +++++----- inx/inkstitch_input_VIP.inx | 17 -------------- inx/inkstitch_input_ZSK.inx | 17 -------------- 30 files changed, 20 insertions(+), 471 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_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 rename inx/{inkstitch_input_EDR.inx => inkstitch_input_TBF.inx} (63%) delete mode 100644 inx/inkstitch_input_THR.inx rename inx/{inkstitch_input_U00.inx => inkstitch_input_U01.inx} (70%) delete mode 100644 inx/inkstitch_input_VIP.inx delete mode 100644 inx/inkstitch_input_ZSK.inx diff --git a/bin/gen-input-inx b/bin/gen-input-inx index 6351d062e..ae32b43fa 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 38ebe7bda..000000000 --- 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 444270f0b..000000000 --- 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 0c3e2096d..000000000 --- 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 e82694b8c..000000000 --- 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 8b7c6b029..c78e1c2d9 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_EXY.inx b/inx/inkstitch_input_EXY.inx deleted file mode 100644 index 78de68d89..000000000 --- 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 c2be8c60f..000000000 --- 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 20a9fda03..000000000 --- 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 bbac96a22..000000000 --- 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 9c07ed7f6..000000000 --- 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 0f5ed9522..000000000 --- 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 a0181182d..000000000 --- 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 15d877d89..000000000 --- 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 3e1623559..000000000 --- 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 eff3c2f77..000000000 --- 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 684b7e206..000000000 --- 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 44d2d6df0..000000000 --- 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 1a030e53e..000000000 --- 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 0e14f0971..000000000 --- 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 3c2d10f5f..000000000 --- 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 d811ff02f..000000000 --- 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 b64e285be..000000000 --- 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 855336595..000000000 --- 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 eb6ab6d9a..000000000 --- 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_EDR.inx b/inx/inkstitch_input_TBF.inx similarity index 63% rename from inx/inkstitch_input_EDR.inx rename to inx/inkstitch_input_TBF.inx index 92cf7d147..e2b72ec93 100644 --- a/inx/inkstitch_input_EDR.inx +++ b/inx/inkstitch_input_TBF.inx @@ -1,14 +1,14 @@ - <_name>EDR file input - org.inkstitch.input.edr + <_name>TBF file input + org.inkstitch.input.tbf 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 + .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_U00.inx b/inx/inkstitch_input_U01.inx similarity index 70% rename from inx/inkstitch_input_U00.inx rename to inx/inkstitch_input_U01.inx index b28da66d3..befadd5b4 100644 --- a/inx/inkstitch_input_U00.inx +++ b/inx/inkstitch_input_U01.inx @@ -1,14 +1,14 @@ - <_name>U00 file input - org.inkstitch.input.u00 + <_name>U01 file input + org.inkstitch.input.u01 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 + .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_ZSK.inx b/inx/inkstitch_input_ZSK.inx deleted file mode 100644 index 4178126fa..000000000 --- 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 - -