[Pythonmac-SIG] Should Python.app be an LSUIElement = 1 app?

Christopher Barker Chris.Barker at noaa.gov
Tue Feb 3 18:49:31 CET 2009


Bill,

Thanks for making the effort to understand and explain all this. Many of 
us remember the many "why won't this work!" posts to the mailing 
list.... so we just want to be careful.

Some concerns:

> ``LSUIElement (String). If this key is set to '1', Launch Services runs
> the application as an agent application. Agent applications do not
> appear in the Dock or in the Force Quit window.

This is a concern -- what if I do need to "Force Quit" my app? I can 
probably find it with ps, and kill it with kill, but that's only because 
I was a Linux geek before I got a Mac.

Also, if you do want an icon in the dock -- even the default rocket -- 
you would need to do something special to get it, no?

Though: I've tried changing my info.plist and haven't seen any change at 
all -- how do I know if I did it right?

> I'm *only* suggesting this for Python.app --

That's not an ONLY -- that's how most python code is run. IDLE.app is an 
exception -- that's the point here, it sounds like you are trying to 
make things work better for non-gui, background-ish apps, but neglecting 
GUI development.

Sure, once I've got my big app written and bundled up with py2app, I can 
set the info.plist the way I want (and py2app can do "the right thing" 
by default.), but I have a LOT of little wx scripts that I want to work 
when started from the command line.

In short:

I should be able start this script from the command line:

import wx
A = wx.App()
F = wx.Frame(None)
F.Show()

And get a dock icon, and have it show up in Force Quit, and be able to 
do everything else GUI it would usually do.

> The key is that you can always make the process more "heavyweight", but
> you can't go in the other direction.  So Python should start as low as
> possible, and work up as necessary

Which does make sense. As there are really only a few GUI toolkits:

wxPython
TkInter
pyObjC
pyQT

It may be fine to have the GUI code promote the app, but we do need to 
get those devs on board (as Robin apparently already is).

And another option is the "pythonb" option for background apps, 
analogous to the old pythonw

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list