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

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 ...@@ -35,7 +35,6 @@ import copy
import csv import csv
import numbers import numbers
import os import os
import pkg_resources
import sys import sys
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
...@@ -113,15 +112,8 @@ class ElementsDatabase(object): ...@@ -113,15 +112,8 @@ class ElementsDatabase(object):
__metaclass__ = Singleton __metaclass__ = Singleton
try: _DEFAULT_DATABASE = os.path.join(os.path.dirname(__file__),"elements_database.csv")
_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
# The user path # The user path
_USER_DATABASE = os.path.join(PLATFORM.application_directory(), "elements_database.csv") _USER_DATABASE = os.path.join(PLATFORM.application_directory(), "elements_database.csv")
......
import os import os
import pkg_resources
import sys import sys
import wx import wx
...@@ -14,13 +13,7 @@ class Icons(object): ...@@ -14,13 +13,7 @@ class Icons(object):
name, width, height = item name, width, height = item
try: icon = os.path.join(os.path.dirname(__file__),name+".png")
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
image = wx.ImageFromBitmap(wx.Bitmap(icon)) image = wx.ImageFromBitmap(wx.Bitmap(icon))
image = image.Scale(width, height, wx.IMAGE_QUALITY_HIGH) 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