Re: [Pyobjc-dev] applicationShouldOpenUntitledFile_
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-02-02 20:17:07
|
On Sunday, Feb 2, 2003, at 19:42 Europe/Amsterdam, Just van Rossum wrote: > bb...@ma... wrote: > >> That's weird. I just tried: >> >> - creating new project from multi-doc template >> >> - changing the YES to a NO as shown below >> >> - ran the app >> >> Untitled document showed up... > > Maybe Ronald tried with an app built with bundlebuilder? That to (I'm also using Python 2.3). > > I just tried > this and can't get an untitled window to begin with... What was the > magic you hacked around again to make this work? Maybe the sh wrapper > doesn't pass the right arguments. The magic is in the wrapper for NSApplicationMain, that shouldn't be a problem. > > Speaking of which: my first shell script ever (the exec wrapper) > suffers > from a typical bug: it doesn't work if the path to the app contains > spaces :-( I'll look into it. This should do it (quoting all assignments): #!/bin/sh execdir="$(dirname ${0})" executable="${execdir}/python" resdir="$(dirname "${execdir}")/Resources" main="${resdir}/main.py" PYTHONPATH="$resdir" export PYTHONPATH exec "${executable}" ${main} ${@:+"${@}"} The ${@:"${@}"} should allow 0 or more arguments with proper quoting (completely untested). Ronald |