diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-08-21 16:45:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-21 16:45:13 -0400 |
| commit | afb886cbe04d19c6b7d1886dfc2c6052646a2dbf (patch) | |
| tree | 2d0a6fe95a26d5b934fe893f3d2b3e94b2aadcc8 /bin/gen-output-inx | |
| parent | 8116f32068a4fe55e7f30ca2a369b2443d89b560 (diff) | |
| parent | 8f700007fc7d3b7866d4e4a3dac6a36bb3e1be2a (diff) | |
Merge pull request #286 from inkstitch/lexelby/i18n-revamp
localize INX files
Diffstat (limited to 'bin/gen-output-inx')
| -rwxr-xr-x | bin/gen-output-inx | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/bin/gen-output-inx b/bin/gen-output-inx deleted file mode 100755 index fbe2ad55..00000000 --- a/bin/gen-output-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_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 pyembroidery_output_formats(): - inx = template.render(format=format, description=description) - - with open("inx/inkstitch_output_%s.inx" % format.upper(), 'w') as inx_file: - print >> inx_file, inx - - -if __name__ == "__main__": - sys.exit(main()) |
