From 512c3411648b24505165d555a04e82ba689f8aed Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 19 Aug 2018 22:14:10 -0400 Subject: integrate inx generation into ink/stitch proper --- bin/gen-input-inx | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 bin/gen-input-inx (limited to 'bin/gen-input-inx') diff --git a/bin/gen-input-inx b/bin/gen-input-inx deleted file mode 100755 index ae32b43f..00000000 --- a/bin/gen-input-inx +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -import sys, os -from os.path import dirname -import pyembroidery -from jinja2 import Environment, FileSystemLoader, select_autoescape - - -def build_environment(): - template_dir = os.path.join(dirname(dirname(os.path.realpath(__file__))), "templates") - - return Environment( - loader = FileSystemLoader(template_dir), - autoescape = True - ) - - -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 pyembroidery_input_formats(): - inx = template.render(format=format, description=description) - - with open("inx/inkstitch_input_%s.inx" % format.upper(), 'w') as inx_file: - print >> inx_file, inx - - -if __name__ == "__main__": - sys.exit(main()) -- cgit v1.2.3