]> granicus.if.org Git - python/commitdiff
Noam Raphael's patch.
authorKurt B. Kaiser <kbk@shore.net>
Sat, 17 May 2003 03:15:48 +0000 (03:15 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sat, 17 May 2003 03:15:48 +0000 (03:15 +0000)
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

Lib/idlelib/CREDITS.txt
Lib/idlelib/NEWS.txt
Lib/idlelib/idle
Lib/idlelib/idle.py
Lib/idlelib/idle.pyw

index fd7af95bdea6caa430c361a8c3f83f045d3bca9e..795dc5e52d4983a5c762c6d5fd594ac60461b42f 100644 (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,
index d24c34b924237b313d6c9a791f913e504ce71c68..26c1fda9815a78cb68e3eae029ed5eb44a2aec8d 100644 (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
index c8a8feaf6ce82a9979de71b886ecc0afe95e37df..449fb0ec90ae6567858a56da200c8ec0ee17d500 100755 (executable)
@@ -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()
index c8a8feaf6ce82a9979de71b886ecc0afe95e37df..449fb0ec90ae6567858a56da200c8ec0ee17d500 100644 (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()
index c8a8feaf6ce82a9979de71b886ecc0afe95e37df..2a61720b40f930e008a7a9f9c345bd00b4a33d8c 100644 (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()