Re: [Pyobjc-dev] Real case for using PyObjC bundles
Brought to you by:
ronaldoussoren
From: Dinu G. <gh...@da...> - 2003-11-13 12:45:59
|
Ronald Oussoren: > PyObjCTools.pluginbuilder should be useable here, but would be > overkill if both the main program and the plugins are Python-based. > You could use the approach used by those plugin modules: > > - Load the bundle using NSBundle > - Look for the main python file (either hardcode a name, or use a key > in the Info.plist) > - Create a new module object, set __path__ to the resources directory > of the bundle, and > execute the main python file in that module > - Now look for the main class using NSBundle.principleClass > > Setting the __path__ is important, this way the resources directory is > treated like a package which makes it possible to use the same module > names in two plugins. I've tried lots of different approaches, none of which yielded the expected success, though... I've also tried an AppKit category, adding loadNibNamed_owner_(nibName, owner) to NSBundle, but also in vain. Therefore, I've compiled a sample module of an app trying to load a plugin, which illustrates the issues. I'd be happy if someone could have a look at this. To run it you must make a symbolic link of the plugin folder to your desktop, then run the app itself. You can find it here, any help sorting this out is much appreci- ated! http://python.net/~gherman/tmp/PluginApp.tar.gz Thanks, Dinu -- Dinu C. Gherman - http://python.net/~gherman ...................................................................... "The best way to predict the future is to invent it." (Alan Kay) |