Commit 2398d578 authored by Tony Lownds's avatar Tony Lownds

1. The command-line arguments for subprocesses no longer need to be

specialized for Mac OS X.

2. buildapp.py - a new file for building an application icon for IDLE on Mac
OS X. See INSTALL.txt
parent e9a54a3e
...@@ -42,6 +42,17 @@ IDLEfork-0.9xx.tar.gz ...@@ -42,6 +42,17 @@ IDLEfork-0.9xx.tar.gz
script to read: script to read:
!# /usr/bin/python2.2 !# /usr/bin/python2.2
On Mac OS X, /usr/bin/python may be pointing at the OS-installed
python, which does not have GUI support. Change the first line of
/usr/bin/idle to read:
#! /usr/bin/env pythonw
Also, to build an IDLE application that can be used from the Finder
on Mac OS X, run:
pythonw buildapp.py build
open build
You will see an IDLE application.
See README.txt for more details on this version of IDLEfork. See README.txt for more details on this version of IDLEfork.
......
...@@ -311,20 +311,6 @@ class ModifiedInterpreter(InteractiveInterpreter): ...@@ -311,20 +311,6 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args)
def build_subprocess_arglist(self): def build_subprocess_arglist(self):
if sys.platform == 'darwin' and sys.argv[0].count('.app'):
# We need to avoid using sys.executable because it fails on some
# of the applet architectures On Mac OS X.
#
# here are the applet architectures tried:
#
# framework applet: sys.executable + -p is correct
# python 2.2 + pure python main applet:
# sys.executable + -p is correct
# pythonw idle.py: sys.executable + -c is correct
#
# XXX what about warnoptions?
return [sys.executable, '-p', str(self.port)]
else:
w = ['-W' + s for s in sys.warnoptions] w = ['-W' + s for s in sys.warnoptions]
# Maybe IDLE is installed and is being accessed via sys.path, # Maybe IDLE is installed and is being accessed via sys.path,
# or maybe it's not installed and the idle.py script is being # or maybe it's not installed and the idle.py script is being
......
#
# After running python setup.py install, run this program from the command
# line like so:
#
# % python2.3 buildapp.py build
#
# A double-clickable IDLE application will be created in the build/ directory.
#
from bundlebuilder import buildapp
buildapp(
name="IDLE",
mainprogram="idle.py",
argv_emulation=1,
)
#!/usr/bin/env pythonw
# IDLE.app
#
# Installation:
# see the install_IDLE target in python/dist/src/Mac/OSX/Makefile
#
# Usage:
#
# 1. Double clicking IDLE icon will open IDLE.
# 2. Dropping file on IDLE icon will open that file in IDLE.
# 3. Launch from command line with files with this command-line:
#
# /Applications/Python/IDLE.app/Contents/MacOS/python file1 file2 file3
#
#
# Add IDLE.app/Contents/Resources/idlelib to path.
# __file__ refers to this file when it is used as a module, sys.argv[0]
# refers to this file when it is used as a script (pythonw macosx_main.py)
import sys
from os.path import split, join, isdir
try:
__file__
except NameError:
__file__ = sys.argv[0]
idlelib = join(split(__file__)[0], 'idlelib')
if isdir(idlelib):
sys.path.append(idlelib)
# see if we are being asked to execute the subprocess code
if '-p' in sys.argv:
# run expects only the port number in sys.argv
sys.argv.remove('-p')
# this module will become the namespace used by the interactive
# interpreter; remove all variables we have defined.
del sys, __file__, split, join, isdir, idlelib
__import__('run').main()
else:
# Load idlelib/idle.py which starts the application.
import idle
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment