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 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.2.3