[Pythonmac-SIG] Building multiple command-line( ( CLI ) programs with py2app

Nicholas Riley njriley at uiuc.edu
Mon Jan 16 22:16:40 CET 2006


On Mon, Jan 16, 2006 at 12:59:41PM -0800, Read Roberts wrote:
> I've run into a glitch in this approach. Although I can easily build a
> py2app application that takes the action name as the first argument, and
> invoke it from the command line  with:
> FDK.app/Contents/MacOS/FDK,
> 
> I cannot execute a symbolic link to the same file, The following produces an
> error:
> 
> Ln -s FDK.app/Contents/MacOS/FDK pythonFDK
> PythonFDK -u
> ->  pythonFDK[834] The Info.plist file must have values for the CFBundleName
> or CFBundleExecutable strings.
> 
> I'd rather not expose an average user to typing a path into the middle of a
> bundle app. Do you know offhand if this issue is fixable, or if  there is a
> way to run the bundle app from the command line and provide sys.argv
> arguments? If this is documented somewhere, just a pointer to the docs would
> be  helpful.

Try using a shell script, for example:

#!/bin/zsh -f

exec FDK.app/Contents/MacOS/FDK $*

If the app can be relocated, as opposed to living in a framework or
similar, you might consider writing a small executable which uses
Launch Services to look up the location of FDK (best by bundle ID,
e.g. com.adobe.FDK) and execs it passing through the arguments as
above.  You could hack the source code of my launch tool to do so
(http://web.sabi.net/nriley/software/#launch).

-- 
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>


More information about the Pythonmac-SIG mailing list