diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-17 20:19:17 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-25 21:17:58 -0400 |
| commit | d189f88050df2db19226f50c80b0304c7bd1bd28 (patch) | |
| tree | 30ca4ef0ae162255fea6645114393d71bccb3ef4 /bin | |
| parent | c061b3a66aaf1f404440e3aa511b8655dd5b1592 (diff) | |
update zip output generator and INX
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/gen-zip-inx | 21 |
1 files changed, 6 insertions, 15 deletions
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) |
