[Pythonmac-SIG] extractClasses and NIB 3.0
Ronald Oussoren
ronaldoussoren at mac.com
Tue Jun 3 16:38:51 CEST 2008
Georg,
PyObjCTools.NibClassBuilder does not support NIB files that are created with Interface Builder 3.
On the positive side: when you use Xcode 3 to edit your source code Interface Builder will automaticly pick up class definitions in your python code, which takes away a major reason for having NibClassBuilder in the first place.
Ronald
On Tuesday, June 03, 2008, at 04:15PM, "Georg Seifert" <georg.seifert at gmx.de> wrote:
>Hello,
>
>I try to write a plugin to my app using py2app (the app itself is
>written in ObjectC). My program is targeted for Leopard only so my NIB-
>Files are version 3.x.
>
>it seems, that "NibClassBuilder.extractClasses()" cannot read this NIB
>files as I get the following when loading the bundle:
>[..]
>File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
>site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 134, in
>extractClasses
> self._extractClassesFromNibFromBundle(nibName, bundle)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line
>152, in _extractClassesFromNibFromBundle
> self._extractClassesFromNibFromPath(path)
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
>python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line
>162, in _extractClassesFromNibFromPath
> raise NibLoaderError, "Invalid NIB file [%s]" % path
>PyObjCTools.NibClassBuilder.NibLoaderError: Invalid NIB file [/Users/
>G.....
>
>
>
>Is there a problem with my python installation as is uses the python
>2.4 path ( in the ?
>
>Or are NIB 3.x file not supported
>Or do I miss something obvious?
>
>
>My Python code:
>
>NibClassBuilder.extractClasses("MyWindow", bundle=NSBundle.mainBundle())
>
>class MyExporter(NibClassBuilder.AutoBaseClass):
>
>
>Thanks
>Georg
>_______________________________________________
>Pythonmac-SIG maillist - Pythonmac-SIG at python.org
>http://mail.python.org/mailman/listinfo/pythonmac-sig
>
>
More information about the Pythonmac-SIG
mailing list