diff options
Diffstat (limited to 'lib/inx')
| -rw-r--r-- | lib/inx/utils.py | 17 |
1 files changed, 14 insertions, 3 deletions
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 |
