Noam Raphael's patch.

SF Patch 686254 "Run IDLEfork from any directory without set-up"

Allows IDLE to run when not installed and cwd is not the IDLE directory.

I took the liberty of moving it to the startup scripts since once IDLEfork
is again a part of Python it will be superfluous and I don't want it to
be forgotten.  But it is very useful for those using IDLEfork standalone!

M CREDITS.txt
M NEWS.txt
M idle
M idle.py
M idle.pyw
This commit is contained in:
Kurt B. Kaiser 2003-05-17 03:15:48 +00:00
parent ab0053aa13
commit a80d57c41d
5 changed files with 52 additions and 14 deletions

View File

@ -13,15 +13,16 @@ improvements.
Besides Guido, the main developers who have been active on IDLEfork version
0.8.1 and later are Stephen M. Gava, who implemented the Configuration GUI, the
new configuration system, and the new About menu, and Kurt B. Kaiser, who
completed the integration of the RPC and remote debugger, and made a number of
usability enhancements.
completed the integration of the RPC and remote debugger, implemented the
threaded subprocess, and made a number of usability enhancements.
Other contributors include Raymond Hettinger, Tony Lownds (Mac integration),
Neal Norwitz (code check and clean-up), and Chui Tey (RPC integration, debugger
integration and persistent breakpoints).
Hernan Foffani, Christos Georgiou, Jason Orendorff, Josh Robb, and Bruce
Sherwood have submitted useful patches. Thanks, guys!
Hernan Foffani, Christos Georgiou, Martin v. Loewis, Jason Orendorff,
Noam Raphael, Josh Robb, and Bruce Sherwood have submitted useful patches.
Thanks, guys!
There are others who should be included here, especially those who contributed
to IDLE versions prior to 0.8, principally Mark Hammond, Jeremy Hylton,

View File

@ -7,15 +7,24 @@ What's New in IDLEfork 0.9b1?
*Release date: XX-XXX-2003*
- Allow IDLE to run when not installed and cwd is not the IDLE directory
SF Patch 686254 "Run IDLEfork from any directory without set-up" - Raphael
- When a module is run from an EditorWindow: if its directory is not in
sys.path, prepend it. This allows the module to import other modules in
the same directory. Do the same for a script run from the command line.
- Interrupt the subprocess if it is running when the user attempts to
restart the shell, run a module, or exit.
- Improved exception reporting when running commands or scripts from the
command line.
- Added a -n command line switch to start IDLE without the subprocess.
Removed the Shell menu when running in that mode. Updated help messages.
- Added a comment to the shell startup header to indicate when IDLE is not
using the subprocess. (For now, set PyShell.use_subprocess to False to run
in this mode.)
using the subprocess.
- Restore the ability to run without the subprocess. This can be important for
some platforms or configurations. (Running without the subprocess allows the

View File

@ -4,7 +4,17 @@ try:
import idlelib.PyShell
except ImportError:
# IDLE is not installed, but maybe PyShell is on sys.path:
import PyShell
PyShell.main()
try:
import PyShell
except ImportError:
print "Can't locate PyShell.py"
else:
import os
idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
if idledir != os.getcwd():
# We're not in the IDLE directory, help the subprocess find run.py
pypath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = pypath + ':' + idledir
PyShell.main()
else:
idlelib.PyShell.main()

View File

@ -4,7 +4,17 @@ try:
import idlelib.PyShell
except ImportError:
# IDLE is not installed, but maybe PyShell is on sys.path:
import PyShell
PyShell.main()
try:
import PyShell
except ImportError:
print "Can't locate PyShell.py"
else:
import os
idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
if idledir != os.getcwd():
# We're not in the IDLE directory, help the subprocess find run.py
pypath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = pypath + ':' + idledir
PyShell.main()
else:
idlelib.PyShell.main()

View File

@ -1,10 +1,18 @@
#!/usr/bin/python
try:
import idlelib.PyShell
except ImportError:
# IDLE is not installed, but maybe PyShell is on sys.path:
import PyShell
PyShell.main()
try:
import PyShell
except ImportError:
print "Can't locate PyShell.py"
else:
import os
idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
if idledir != os.getcwd():
# We're not in the IDLE directory, help the subprocess find run.py
pypath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = pypath + ':' + idledir
PyShell.main()
else:
idlelib.PyShell.main()