Re: [Pyobjc-dev] problems in bridge metadata lookup
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2008-01-23 20:57:16
|
On 23 Jan, 2008, at 17:00, scott herzinger wrote: > In trying to use some bridgesupport files that I generated, I came > across a couple problems that prevented files under /Library or ~/ > Library from being found. > > objc.initFrameworkWrapper throws a NameError when the bridgesupport > file is in /Library/BridgeSupport. It throws an ImportError when the > bridgesupport file is in ~/Library/BridgeSupport. > > The former looks like a typo in objc/_bridgesupport.py where > "framework" is misspelled as "framwork". I think the latter is a > result of not expanding "~" to the user's home directory. Replacing > the path with os.path.expanduser(path) fixes it for me. The patch I'm > using follows. Thanks for the report. I've applied a simular fix to the pyobjc repository, which will some day be pyobjc 2.1. FWIW You'll probably have to add a flag to enable loading bridgesupport files ~/Library/BridgeSupport or /Library/BridgeSupport because the current behaviour makes it too easy to create .app bundles that won't run on other people's machines. IMHO there are two good ways for shipping bridgesupport files: (1) inside the framework itself and (2) as a PyObjC.bridgesupport file inside the python wrapper for the framework. The former has the advantage that other language bridges can also use the file, but can of course only be done by the author of the framework. Ronald |