[Pythonmac-SIG] FBAs with bundlebuilder?

Ronald Oussoren ronaldoussoren at mac.com
Sun Sep 19 10:26:46 CEST 2004


On 19-sep-04, at 2:16, has wrote:
[... example code removed ...]

> (Note: I'd really like the build script to go away in default cases, 
> and just have a drag-n-drop applet that takes the mainprogram script 
> and creates the application directly from that. Only time a build 
> script should be needed is if you want to include 3rd-party modules in 
> the application. Still working on this.)
>
>
> I've made it as procedural as possible, avoiding any need to write 
> classes as most ASers don't know squat about OOP. This means I can't 
> use 'aehandler' decorators and auto-discovery here, since decorators 
> don't work on modules, but never mind... and I guess it's one fewer 
> 'advanced' language concept for ASers to grok.
Decorators would also work on module level functions, but you'd have to 
create the Application instance before defining the ae-functions. You 
would need python2.4 to use decorators, which would make it harder to 
get your code accepted in the AS community.

> It's something I still intend to explore in the broader aeom 
> framework, which will be targeted squarely at Python-based application 
> developers and support stuff like resolving object specifiers against 
> an application's object model. Though it's early days and I'm still 
> working on ideas for this as it's a pretty major project. [1][2]

That sounds like major undertaking, especially when you want to support 
more than one GUI toolkit (Carbon, Cocoa, WxWidgets, ...).

>
>
> BTW, anyone know if there's a bug/request filed on BB-built 
> applications to do something about them falling over and dying upon 
> launch if there's a bug in the top-level code of the mainprogram 
> script or that of any of its dependencies. This is something 
> AppleScript applets handle quite nicely: if a bug occurs on launch (or 
> any other time for that matter), an error dialog appears describing 
> the problem, along with a button you can click to open the script in 
> Script Editor ready for fixing. ASers definitely won't tolerate the 
> current behaviour, so something will definitely need done about it 
> asap.

Bundlebuilder could use some surgery. One thing I'd like to add to 
bundlebuilder is the use of a custom main program, like the one used in 
the PyObjC Xcode templates. That would remove one step in bootstrap 
process, and would probably make it easier to add an error dialog.

>
> Cheers,
>
> has
>
> --
>
> [1] Any ideas if/how an Apple Event Object Model support framework 
> could be made to play nice with PyObjC apps? Presumably AE handling in 
> PyObjC-based apps falls to Cocoa Scripting by default? Whereas aeom 
> would build on aem.receive and aem.types.objectspecifier, which are 
> powered by the Carbon Apple Event Manager.

Does the Carbon Apple Event Manager use CFRunLoop for running the main 
event loop? If so, it should be possible to use your code in a Cocoa 
application. I haven't played around with supporting AE in a Cocoa 
application yet, which makes it hard to answer you question :-)

Ronald



More information about the Pythonmac-SIG mailing list