Browse Source

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
283
Maran 10 years ago
parent
commit
fd8a931608
  1. 1
      .gitignore
  2. 9
      lib/util.py
  3. 2
      setup-release.py

1
.gitignore

@ -13,3 +13,4 @@ gui/qt/icons_rc.py
locale/
.devlocaltmp/
*_trial_temp
packages

9
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()

2
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"])),

Loading…
Cancel
Save