diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-09-09 00:06:47 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-09-09 00:07:59 -0400 |
| commit | b437b8403c4758813c780b16cebe8357e95a8746 (patch) | |
| tree | 98c42c1e3cc86dd32ff04236402dc160691078e1 /lib | |
| parent | c980279ae681561a5066f929998d437eb6f256f3 (diff) | |
fix pencil icon path
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/extensions/params.py | 4 | ||||
| -rw-r--r-- | lib/utils/paths.py | 6 |
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)) |
