diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/build-dist | 2 | ||||
| -rwxr-xr-x | bin/gen-input-inx | 36 | ||||
| -rwxr-xr-x | bin/gen-output-format-option-list | 14 | ||||
| -rwxr-xr-x | bin/gen-output-inx | 36 | ||||
| -rwxr-xr-x | bin/gen-zip-inx | 35 | ||||
| -rwxr-xr-x | bin/generate-inx-files | 17 | ||||
| -rwxr-xr-x | bin/pyembroidery-gettext | 10 |
7 files changed, 28 insertions, 122 deletions
diff --git a/bin/build-dist b/bin/build-dist index a96b7506..c740c782 100755 --- a/bin/build-dist +++ b/bin/build-dist @@ -29,7 +29,7 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then fi # This lets pyinstaller see inkex.py, etc. -pyinstaller_args+="-p inkscape-0.92.3/share/extensions " +pyinstaller_args+="-p inkscape/share/extensions " # output useful debugging info that helps us trace library dependency issues pyinstaller_args+="--log-level DEBUG " 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()) diff --git a/bin/gen-output-format-option-list b/bin/gen-output-format-option-list deleted file mode 100755 index 28a83976..00000000 --- a/bin/gen-output-format-option-list +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python - -import sys -import pyembroidery - -formats = [format for format in pyembroidery.supported_formats() if 'writer' in format] -formats.sort(key=lambda format: (format['category'] != 'embroidery', format['extension'])) - -for format in formats: - tag = "" - if format['category'] != 'embroidery': - tag = " [DEBUG]" - - print '<_option value="%s">%s(%s)%s</_option>' % (format['extension'], format['description'], format['extension'].upper(), tag) 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()) diff --git a/bin/gen-zip-inx b/bin/gen-zip-inx deleted file mode 100755 index 40948786..00000000 --- a/bin/gen-zip-inx +++ /dev/null @@ -1,35 +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_zip_output.inx') - - inx = template.render(formats=pyembroidery_output_formats()) - - with open("inx/inkstitch_output_ZIP.inx", 'w') as inx_file: - inx_file.write(inx) - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/bin/generate-inx-files b/bin/generate-inx-files new file mode 100755 index 00000000..a16fb32e --- /dev/null +++ b/bin/generate-inx-files @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import sys +import os +from os.path import dirname + +# add inkstitch libs to python path +parent_dir = os.path.join(dirname(dirname(__file__))) +sys.path.append(parent_dir) + +# try find add inkex.py et al. as well +sys.path.append(os.path.join(parent_dir, "inkscape", "share", "extensions")) +sys.path.append(os.path.join("/usr/share/inkscape/extensions")) + +from lib.inx import generate_inx_files + +generate_inx_files() diff --git a/bin/pyembroidery-gettext b/bin/pyembroidery-gettext new file mode 100755 index 00000000..ac9bd1ab --- /dev/null +++ b/bin/pyembroidery-gettext @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +import pyembroidery + + +# generate fake python code containing the descriptions of pyembroidery formats +# as gettext calls so that pybabel will extract them into messages.po +for format in pyembroidery.supported_formats(): + print "# L10N description for pyembroidery file format: %s" % format['extension'] + print "_(%s)" % repr(format['description']) |
