mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
Add dynamic package loading for Py2App osx binaries
This commit is contained in:
parent
3ef3bebeb3
commit
2bf32880e8
1 changed files with 13 additions and 4 deletions
17
electrum
17
electrum
|
@ -26,14 +26,23 @@ import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
is_local = False
|
||||||
|
is_android = False
|
||||||
|
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
is_bundle = getattr(sys, 'frozen') == "macosx_app"
|
||||||
|
if is_bundle:
|
||||||
|
sys.path.insert(0, os.getcwd() + "/lib/python2.7/packages")
|
||||||
|
else:
|
||||||
|
is_bundle = getattr(sys, 'frozen', False)
|
||||||
|
is_local = not is_bundle and os.path.dirname(os.path.realpath(__file__)) == os.getcwd()
|
||||||
|
is_android = 'ANDROID_DATA' in os.environ
|
||||||
|
if is_local:
|
||||||
|
sys.path.append('packages')
|
||||||
|
|
||||||
is_bundle = getattr(sys, 'frozen', False)
|
|
||||||
is_local = not is_bundle and os.path.dirname(os.path.realpath(__file__)) == os.getcwd()
|
is_local = not is_bundle and os.path.dirname(os.path.realpath(__file__)) == os.getcwd()
|
||||||
is_android = 'ANDROID_DATA' in os.environ
|
is_android = 'ANDROID_DATA' in os.environ
|
||||||
|
|
||||||
if is_local:
|
|
||||||
sys.path.insert(0,'packages')
|
|
||||||
|
|
||||||
import __builtin__
|
import __builtin__
|
||||||
__builtin__.use_local_modules = is_local or is_android
|
__builtin__.use_local_modules = is_local or is_android
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue