Re: [Pyobjc-dev] Separating functionality into modules
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@cw...> - 2002-11-20 13:19:05
|
On Wednesday, Nov 20, 2002, at 08:19 Europe/Amsterdam, Ronald Oussoren wrote: > That said, I'd like to build a module or script to build a template > from wrapping yet another Objective-C class library. I don't think it > would be usefull to use 'AddressBook = > Foundation.Python.GenerateModuleForBundle("AddressBook")' as a > replacement for 'import AddressBook' For this specific case you're right. But if we have the mechanism to dynamically create modules (and that's a big "if", considering Bills remarks) I think we should go down the dynamic path in stead of the static path. To give you an example: MacPython builds AppleScript modules by parsing the AETE resources and generating Python code to handle the objects and verbs and such. The fact that this isn't done dynamically means that you cannot interface to a new scriptable application without first going through the motions of creating the interface modules, while it would be much nicer if this was done on the fly. But by now the parsing and generation code has become so big and complex that changing it to something more dynamic is going to be too much hassle. > It is already there: > >>> import objc > >>> print objc.__version__ > 0.7.1 > >>> Great! (BTW: the Official Python Way to say that something is already there is to use Guido's time machine. As in "Version numbers? Good idea. One moment, let me borrow Guido's time machine.... [poof]. It's implemented" :-) -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |