Commit 0452629b authored by eric pellegrini's avatar eric pellegrini

bug fix related to pkg_resources on macos

parent 432ff5a2
Pipeline #1485 passed with stages
in 11 minutes and 13 seconds
......@@ -35,7 +35,6 @@ import copy
import csv
import numbers
import os
import pkg_resources
import sys
import xml.etree.ElementTree as etree
......@@ -113,15 +112,8 @@ class ElementsDatabase(object):
__metaclass__ = Singleton
try:
_DEFAULT_DATABASE = pkg_resources.resource_filename(__name__,"elements_database.csv")
except:
if hasattr(sys,'frozen'):
_DEFAULT_DATABASE = os.path.join(os.path.dirname(sys.executable),"elements_database.csv")
else:
raise
_DEFAULT_DATABASE = os.path.join(os.path.dirname(__file__),"elements_database.csv")
# The user path
_USER_DATABASE = os.path.join(PLATFORM.application_directory(), "elements_database.csv")
......
import os
import pkg_resources
import sys
import wx
......@@ -14,13 +13,7 @@ class Icons(object):
name, width, height = item
try:
icon = pkg_resources.resource_filename(__name__,name+".png")
except:
if hasattr(sys,'frozen'):
icon = os.path.join(os.path.dirname(sys.executable),name+".png")
else:
raise
icon = os.path.join(os.path.dirname(__file__),name+".png")
image = wx.ImageFromBitmap(wx.Bitmap(icon))
image = image.Scale(width, height, wx.IMAGE_QUALITY_HIGH)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment