Thread: [Pyobjc-dev] py2app --frameworks problem
Brought to you by:
ronaldoussoren
From: Neil Martinsen-B. <nbu...@un...> - 2005-06-20 20:12:35
|
I am having problems trying to include a separate framework using py2app. I am unable to load the bundle from within my app, and looking in site-packages.zip, the framework doesn't appear to have been included. The setup.py is below. The error message is: $ dist/Ernie.app/Contents/MacOS/Ernie 2005-06-20 16:09:00.516 Ernie[6671] Exception raised during posting of notification. Ignored. exception: exceptions.ImportError: Bundle could not be loaded Is there some more information that I need to be specifying? Thanks. Peace, -Neil setup.py --- cut here --- from distutils.core import setup import py2app SCRIPT = 'statusitem.py' app_data = dict(script=SCRIPT) setup( app = [app_data], data_files = ["MainMenu.nib"], options = dict(py2app=dict( frameworks=['/Users/nburrell/Library/Frameworks/Keychain.framework'] )) ) -- Neil Martinsen-Burrell nbu...@un... |
From: Bob I. <bo...@re...> - 2005-06-21 18:36:05
|
On Jun 20, 2005, at 4:12 PM, Neil Martinsen-Burrell wrote: > I am having problems trying to include a separate framework using > py2app. I am unable to load the bundle from within my app, and > looking in site-packages.zip, the framework doesn't appear to have > been included. The setup.py is below. The error > message is: Frameworks certainly do not end up in site-packages.zip, they end up in Contents/Frameworks > $ dist/Ernie.app/Contents/MacOS/Ernie > 2005-06-20 16:09:00.516 Ernie[6671] Exception raised during posting of > notification. Ignored. exception: exceptions.ImportError: Bundle > could not be loaded > > Is there some more information that I need to be specifying? Thanks. > Peace, Try using py2app from svn, I've fixed a regression in the frameworks option since the release of 0.2. -bob |
From: Neil Martinsen-B. <nbu...@un...> - 2005-06-21 18:31:24
|
On Tue, Jun 21, 2005 at 09:57:46AM -0400, Bob Ippolito wrote: > > On Jun 20, 2005, at 4:12 PM, Neil Martinsen-Burrell wrote: > > >I am having problems trying to include a separate framework using > >py2app. I am unable to load the bundle from within my app, and > >looking in site-packages.zip, the framework doesn't appear to have > >been included. The setup.py is below. The error > >message is: > > Frameworks certainly do not end up in site-packages.zip, they end up > in Contents/Frameworks Duly noted. I did not see it there and went looking for it elsewhere. > >$ dist/Ernie.app/Contents/MacOS/Ernie > >2005-06-20 16:09:00.516 Ernie[6671] Exception raised during posting of > >notification. Ignored. exception: exceptions.ImportError: Bundle > >could not be loaded > > > >Is there some more information that I need to be specifying? Thanks. > >Peace, > > Try using py2app from svn, I've fixed a regression in the frameworks > option since the release of 0.2. The svn version fixes the problem with including the framework in the application bundle. Is os.path.join(NSBundle.bundleForClass_(MyClass).bundlePath(),'Contents/Frameworks') the appropriate way to access the frameworks directory in the app bundle? Thanks. Peace, -Neil -- Neil Martinsen-Burrell nbu...@un... |
From: Bob I. <bo...@re...> - 2005-06-21 19:29:56
|
On Jun 21, 2005, at 12:12 PM, Neil Martinsen-Burrell wrote: > On Tue, Jun 21, 2005 at 09:57:46AM -0400, Bob Ippolito wrote: > >>> $ dist/Ernie.app/Contents/MacOS/Ernie >>> 2005-06-20 16:09:00.516 Ernie[6671] Exception raised during >>> posting of >>> notification. Ignored. exception: exceptions.ImportError: Bundle >>> could not be loaded >>> >>> Is there some more information that I need to be specifying? >>> Thanks. >>> Peace, >>> >> >> Try using py2app from svn, I've fixed a regression in the frameworks >> option since the release of 0.2. >> > > The svn version fixes the problem with including the framework in the > application bundle. Is > os.path.join(NSBundle.bundleForClass_(MyClass).bundlePath > (),'Contents/Frameworks') > the appropriate way to access the frameworks directory in the app > bundle? Thanks. Peace, That depends on whether you're writing a plug-in or an application. Generally, with applications, you just write NSBundle.mainBundle(), and save the class-relative bundle stuff for when you're doing plug- ins. If this is module-level code, you can use objc.loadBundle(), which is designed to do the right thing in either case. The correct way to get the Frameworks directory is to use -[NSBundle privateFrameworksPath].. i.e.: # this must be called during module import, or else objc.currentBundle () might return the wrong thing. frameworkPath = objc.currentBundle().privateFrameworksPath() -bob |