summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-07-17 20:14:23 -0400
committerLex Neva <github.com@lexneva.name>2018-07-25 21:17:58 -0400
commit17a9f23bfb8b3a150092bc499cdaf533e3390719 (patch)
tree7bcc243deb152a577b3dce995eff7fe222b1cd83 /bin
parentf85ee33af6fdb11bdd85af4e0832b9f2ef40b315 (diff)
update input extension generator and INXes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gen-input-inx23
1 files changed, 7 insertions, 16 deletions
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__":