summaryrefslogtreecommitdiff
path: root/lib/inx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inx')
-rwxr-xr-xlib/inx/extensions.py7
-rw-r--r--lib/inx/utils.py17
2 files changed, 21 insertions, 3 deletions
diff --git a/lib/inx/extensions.py b/lib/inx/extensions.py
index d1a0c7f3..030e8aa6 100755
--- a/lib/inx/extensions.py
+++ b/lib/inx/extensions.py
@@ -4,6 +4,7 @@ from .utils import build_environment, write_inx_file
from .outputs import pyembroidery_output_formats
from ..extensions import extensions, Input, Output
from ..commands import LAYER_COMMANDS, OBJECT_COMMANDS, GLOBAL_COMMANDS, COMMANDS
+from ..threads import ThreadCatalog
def layer_commands():
@@ -27,6 +28,11 @@ def pyembroidery_debug_formats():
yield format['extension'], format['description']
+def threadcatalog():
+ threadcatalog = ThreadCatalog().palette_names()
+ return threadcatalog
+
+
def generate_extension_inx_files():
env = build_environment()
@@ -38,6 +44,7 @@ def generate_extension_inx_files():
template = env.get_template('%s.inx' % name)
write_inx_file(name, template.render(formats=pyembroidery_output_formats(),
debug_formats=pyembroidery_debug_formats(),
+ threadcatalog=threadcatalog(),
layer_commands=layer_commands(),
object_commands=object_commands(),
global_commands=global_commands()))
diff --git a/lib/inx/utils.py b/lib/inx/utils.py
index 1dc96829..a7c98a60 100644
--- a/lib/inx/utils.py
+++ b/lib/inx/utils.py
@@ -1,11 +1,12 @@
import errno
-import os
import gettext
+import os
+import sys
from os.path import dirname
-from jinja2 import Environment, FileSystemLoader
-from ..i18n import translation as default_translation, locale_dir, N_
+from jinja2 import Environment, FileSystemLoader
+from ..i18n import N_, locale_dir, translation as default_translation
_top_path = dirname(dirname(dirname(os.path.realpath(__file__))))
inx_path = os.path.join(_top_path, "inx")
@@ -25,6 +26,16 @@ def build_environment():
env.install_gettext_translations(current_translation)
env.globals["locale"] = current_locale
+ if "BUILD" in os.environ:
+ # building a ZIP release, with inkstitch packaged as a binary
+ if sys.platform == "win32":
+ env.globals["command_tag"] = '<command reldir="extensions">inkstitch/bin/inkstitch.exe</command>'
+ else:
+ env.globals["command_tag"] = '<command reldir="extensions">inkstitch/bin/inkstitch</command>'
+ else:
+ # user is running inkstitch.py directly as a developer
+ env.globals["command_tag"] = '<command reldir="extensions" interpreter="python">inkstitch.py</command>'
+
return env