diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-02-24 23:17:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-02-24 23:17:23 (GMT) |
commit | 9c93fe829bc6f85589b261a108073f914f1f9981 (patch) | |
tree | ab107d4f72b9bb08a53b56d8d4eda37c7f7b3d48 | |
parent | c7d53629e78503c9fed481525ab5d976b24a0b79 (diff) | |
download | cpython-9c93fe829bc6f85589b261a108073f914f1f9981.zip cpython-9c93fe829bc6f85589b261a108073f914f1f9981.tar.gz cpython-9c93fe829bc6f85589b261a108073f914f1f9981.tar.bz2 |
Backport of 1.27 and 1.28:
- 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.
-rw-r--r-- | Mac/Tools/IDE/PyEdit.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index 828b697..fcbdc09 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -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() |