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