commit fd8a931608d3676cf7220dc955b41b7b95dbc14b
parent 2bf32880e85cb092e55f4c42be2aea872e4d2b0e
Author: Maran <maran.hidskes@gmail.com>
Date: Tue, 27 Jan 2015 12:22:28 +0100
Make where() work with OSX app bundles
MEIPASS is PythonInstaller specific and won't work for py2app
modified: lib/util.py
modified: .gitignore
modified: lib/util.py
modified: setup-release.py
Diffstat:
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -13,3 +13,4 @@ gui/qt/icons_rc.py
locale/
.devlocaltmp/
*_trial_temp
+packages
diff --git a/lib/util.py b/lib/util.py
@@ -66,8 +66,13 @@ def data_dir():
if __builtin__.use_local_modules:
return local_data_dir()
else:
- if getattr(sys, 'frozen'):
- basedir = sys._MEIPASS
+ is_frozen = getattr(sys, 'frozen')
+ if is_frozen:
+ if is_frozen == "macosx_app":
+ basedir = os.path.abspath(".")
+ else:
+ basedir = sys._MEIPASS
+
return os.path.join(basedir, 'data')
else:
return appdata_dir()
diff --git a/setup-release.py b/setup-release.py
@@ -37,7 +37,7 @@ if sys.platform == 'darwin':
app=[mainscript],
options=dict(py2app=dict(argv_emulation=True,
includes=['PyQt4.QtCore', 'PyQt4.QtGui', 'PyQt4.QtWebKit', 'PyQt4.QtNetwork', 'sip'],
- packages=['lib', 'gui', 'plugins'],
+ packages=['lib', 'gui', 'plugins', 'packages'],
iconfile='electrum.icns',
plist=plist,
resources=["data", "icons"])),