[Pythonmac-SIG] Wrapping a framework

Dethe Elza delza at livingcode.org
Tue May 17 20:49:20 CEST 2005


Hi folks,

I've wrapped a couple of frameworks using the following idiom with no  
problem, but now I'm trying to wrap the framework that comes with  
Skype and it's refusing to load the bundle.  Any ideas what I could  
be doing wrong?

# Contents of Skype/__init__.py in path:
import objc, AppKit, Foundation, os
if 'site-packages.zip' in __file__:
   base_path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks')
else:
   base_path = '/Applications/Skype.app/Contents/Frameworks'
   # I have also tried moving the framework to /Library/Frameworks  
and using that path, with the same result
bundle_path = os.path.abspath(os.path.join(base_path,  
'Skype.framework'))
objc.loadBundle('Skype', globals(), bundle_path=bundle_path)
del objc, AppKit, Foundation, os, base_path, bundle_path

# End of __init__.py

 >>> import Skype
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/Skype/__init__.py", line 7, in ?
     objc.loadBundle('Skype', globals(), bundle_path=bundle_path)
ImportError: Bundle could not be loaded

--Dethe

"Debugging is twice as hard as writing the code in the first place.  
Therefore, if you write the code as cleverly as possible, you are, by  
definition, not smart enough to debug it. "  --Brian Kernighan



More information about the Pythonmac-SIG mailing list