[Pythonmac-SIG] IDLE etc build from CVS

Tony Lownds tony@lownds.com
Mon, 17 Feb 2003 13:23:18 -0800


At 11:49 AM -0800 2/17/03, Tony Lownds wrote:
>At 9:08 AM -0800 2/17/03, Jan de Leeuw wrote:
>>When I try to start IDLE from a current CVS build it says in the console
>>
>>>/Applications/MacPython-2.3/IDLE.app/Contents/MacOS/python: can't 
>>>open file 
>>>'/Applications/MacPython-2.3/IDLE.app/Contents/Resources/idle'
>>
>>Turns out  idle sits in Resources/idlelib, not in Resources itself. 
>>Anyone else see this ?
>
>I see the error too. For some reason during the build process 
>BuildApplet.py is not copying  Tools/idle/idle to Resources/idle -- 
>this certainly used to work.
>

I am going to file a bug on SF. Thanks for reporting this, Jan.


Here is the command that is causing trouble:

/Library/Frameworks/../../Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/python 
../python/dist/src/Mac/scripts/BuildApplet.py --output 
/Library/Frameworks/../../Applications/MacPython-2.3/IDLE.app --extra 
../python/dist/src/Tools/idle ../python/dist/src/Tools/idle/idle

or essentially:

python Mac/scripts/BuildApplet.py --output IDLE.app --extra 
Tools/idle Tools/idle/idle

The semantics of BuildApplet.py (well, buildtools.py) changed 
slightly, in a way that upset IDLE's build - it used to copy its 
argument (the main program file) into Resources/ under a new name - 
__main__.py. This changed so that the main program file keeps the 
same file name.

For IDLE, the main program is Tools/idle/idle but the Tools/idle 
directory needs to be copied into the bundle as well; before the 
slight semantic change in buildtools.py this worked OK but now two 
things named "idle" are getting copied to Resources/ and its not 
working.

Its hard to argue that BuildApplet really should support an --extra 
argument with the same basename as the main program file. Perhaps the 
best fix is to integrate the latest idlefork with Python 2.3 - this 
would eliminate this problem because the main file for mac applets is 
not called idle in idlefork.

Another way to fix this would be to extend BuildApplet and buildtools 
and bundlebuilder so that it is possible to specify a new name for 
the --extra argument, something like:

python Mac/scripts/BuildApplet.py --output IDLE.app --extra 
Tools/idle --rename-extra idlelib Tools/idle/idle

But the first fix option seems way more palateable to me.



I think there may be another problem with the latest change to applets:
The __main__.py file used to be executed with the -psn arguments 
filtered out, but now the -psn arguments are not getting filtered out.

Is -psn argument handling the responsibility of the main program? Or 
should bundlebuilder take care of that?

-Tony