Re: [Pyobjc-dev] applicationShouldOpenUntitledFile_
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-02-02 20:23:39
|
Ronald Oussoren wrote: > The magic is in the wrapper for NSApplicationMain, that shouldn't be a > problem. It is if the wrapper doesn't pass the right args... But I've totally lost track of what happens there. Hm, I guess we should compare sys.argv in both situations. > > 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})" One of the main problems was that ${0} _itself_ needed quoting, otherwise dirname only takes the part up to the first space. Or at least that's what I understood was happening. See the CVS log for bundlebuilder.py for my actual patch: it seems to work, but if you see other potential problems, please tell me... > 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). I'll try this, thanks. (It does look worse than Perl, though...) Just |