]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport of 1.27 and 1.28:
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 24 Feb 2002 23:17:23 +0000 (23:17 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 24 Feb 2002 23:17:23 +0000 (23:17 +0000)
- Added minimal support for floating windows.
- Changes by Donovan Preston (and a few minor ones by me) to make IDE run under
MachoPython. Mainly making sure we don't call routines that don't exist
and representing pathnames in a os.separator-neutral format.

These shouldn't interfere too much with Just's work on the next generation IDE,
I hope.

Mac/Tools/IDE/PyEdit.py

index 828b697176e4c3486f3ab1936fd7f303a229c6ca..fcbdc0902e2bf61b4a06e27945bccfed89a021fd 100644 (file)
@@ -17,6 +17,12 @@ import string
 import marshal
 import re
 
+if hasattr(Win, "FrontNonFloatingWindow"):
+       MyFrontWindow = Win.FrontNonFloatingWindow
+else:
+       MyFrontWindow = Win.FrontWindow
+
+
 try:
        import Wthreading
 except ImportError:
@@ -1128,7 +1134,8 @@ def execstring(pytext, globals, locals, filename="<string>", debugging=0,
                        else:
                                PyDebugger.startfromhere()
                elif not haveThreading:
-                       MacOS.EnableAppswitch(0)
+                       if hasattr(MacOS, 'EnableAppswitch'):
+                               MacOS.EnableAppswitch(0)
                try:
                        if profiling:
                                import profile, ProfileBrowser
@@ -1145,7 +1152,8 @@ def execstring(pytext, globals, locals, filename="<string>", debugging=0,
                                exec code in globals, locals
                finally:
                        if not haveThreading:
-                               MacOS.EnableAppswitch(-1)
+                               if hasattr(MacOS, 'EnableAppswitch'):
+                                       MacOS.EnableAppswitch(-1)
        except W.AlertError, detail:
                raise W.AlertError, detail
        except (KeyboardInterrupt, BdbQuit):
@@ -1187,7 +1195,7 @@ def _filename_as_modname(fname):
                        return string.join(string.split(modname, '.'), '_')
 
 def findeditor(topwindow, fromtop = 0):
-       wid = Win.FrontWindow()
+       wid = MyFrontWindow()
        if not fromtop:
                if topwindow.w and wid == topwindow.w.wid:
                        wid = topwindow.w.wid.GetNextWindow()