summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/extensions/params.py4
-rw-r--r--lib/utils/paths.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py
index 2e304c7b..6012263a 100644
--- a/lib/extensions/params.py
+++ b/lib/extensions/params.py
@@ -17,7 +17,7 @@ from .base import InkstitchExtension
from ..i18n import _
from ..stitch_plan import patches_to_stitch_plan
from ..elements import EmbroideryElement, Fill, AutoFill, Stroke, SatinColumn
-from ..utils import save_stderr, restore_stderr, get_bundled_dir
+from ..utils import save_stderr, restore_stderr, get_resource_dir
from ..simulator import EmbroiderySimulator
from ..commands import is_command
@@ -118,7 +118,7 @@ class ParamsTab(ScrolledPanel):
self.settings_grid.AddGrowableCol(1, 2)
self.settings_grid.SetFlexibleDirection(wx.HORIZONTAL)
- self.pencil_icon = wx.Image(os.path.join(get_bundled_dir("icons"), "pencil_20x20.png")).ConvertToBitmap()
+ self.pencil_icon = wx.Image(os.path.join(get_resource_dir("icons"), "pencil_20x20.png")).ConvertToBitmap()
self.__set_properties()
self.__do_layout()
diff --git a/lib/utils/paths.py b/lib/utils/paths.py
index 863e8e69..0da8a154 100644
--- a/lib/utils/paths.py
+++ b/lib/utils/paths.py
@@ -8,3 +8,9 @@ def get_bundled_dir(name):
return realpath(os.path.join(sys._MEIPASS, "..", name))
else:
return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name))
+
+def get_resource_dir(name):
+ if getattr(sys, 'frozen', None) is not None:
+ return realpath(os.path.join(sys._MEIPASS, name))
+ else:
+ return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name))