aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTat-Chee Wan (USM Signature)2013-11-15 15:42:32 +0800
committerTat-Chee Wan (USM Signature)2013-11-15 15:42:32 +0800
commit35eeb729b54f1ae92b350b79f0334be0707519da (patch)
tree59c5df572f52309bed4355e1321e5c9c870e37f6
parent45a69802f8cd8e97ac7ef3dfb05265d10f4af4ea (diff)
improved error handling and reporting for bluetooth compat hackPYFANTOM_BTHACK
-rw-r--r--pyfantom.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pyfantom.py b/pyfantom.py
index daf9b17..c65c275 100644
--- a/pyfantom.py
+++ b/pyfantom.py
@@ -62,8 +62,14 @@ if platform_type == 'Darwin':
if platform_rel >= MACOSX_BTMODVER:
print " Bluetooth Stack not supported (Rel >= %s)" % MACOSX_BTMODVER
MACOSX_BTENABLE = False
+ if os.getenv("DYLD_FORCE_FLAT_NAMESPACE") is None:
+ raise RuntimeError("Bluetooth Compat Framework needed.\n"
+ "Enable IOBluetooth-Compat Framework using:\n"
+ "$ export DYLD_FORCE_FLAT_NAMESPACE=1\n")
+ #compatlibpath = ctypes.util.find_library('IOBluetooth-Compat.dylib')
compatlibpath = '%s/Library/IOBluetooth-Compat.dylib' % os.getenv("HOME")
-
+ if compatlibpath is None or not os.path.exists(compatlibpath):
+ raise RuntimeError("IOBluetooth-Compat Framework not found")
from AppKit import NSAutoreleasePool, NSApplication
elif platform_type == 'Linux':
@@ -73,6 +79,7 @@ elif platform_type == 'Windows':
else:
raise RuntimeError('Unsupported platform')
+
if libpath is not None:
if DEBUG:
print "Found Fantom Library (", libpath, ")"