summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/extensions/base.py4
-rwxr-xr-xlib/extensions/sew_stack_editor.py2
-rwxr-xr-xlib/inx/extensions.py5
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/extensions/base.py b/lib/extensions/base.py
index 4a2895d0..91afbc38 100644
--- a/lib/extensions/base.py
+++ b/lib/extensions/base.py
@@ -18,6 +18,10 @@ from ..update import update_inkstitch_document
class InkstitchExtension(inkex.EffectExtension):
"""Base class for Inkstitch extensions. Not intended for direct use."""
+ # Set to True to hide this extension from release builds of Ink/Stitch. It will
+ # only be available in development installations.
+ DEVELOPMENT_ONLY = False
+
def load(self, *args, **kwargs):
document = super().load(*args, **kwargs)
update_inkstitch_document(document)
diff --git a/lib/extensions/sew_stack_editor.py b/lib/extensions/sew_stack_editor.py
index 6c7cb543..a7cc9e38 100755
--- a/lib/extensions/sew_stack_editor.py
+++ b/lib/extensions/sew_stack_editor.py
@@ -531,6 +531,8 @@ class SewStackPanel(wx.Panel):
class SewStackEditor(InkstitchExtension):
+ DEVELOPMENT_ONLY = True
+
def __init__(self, *args, **kwargs):
self.cancelled = False
InkstitchExtension.__init__(self, *args, **kwargs)
diff --git a/lib/inx/extensions.py b/lib/inx/extensions.py
index cceb40de..d69f0d75 100755
--- a/lib/inx/extensions.py
+++ b/lib/inx/extensions.py
@@ -3,6 +3,8 @@
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+import os
+
import pyembroidery
from ..commands import (COMMANDS, GLOBAL_COMMANDS, LAYER_COMMANDS,
@@ -47,6 +49,9 @@ def generate_extension_inx_files(alter_data):
if extension is Input or extension is Output:
continue
+ if extension.DEVELOPMENT_ONLY and 'BUILD' in os.environ:
+ continue
+
name = extension.name()
template = env.get_template(f'{name}.xml')
write_inx_file(name, template.render(alter_data,