diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-01-21 23:00:52 +0000 |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-01-21 23:00:52 +0000 |
commit | 815d2bf067799d519323a373387f342ec387645b (patch) | |
tree | e26ebc8bd231b418f77cd4357e7fe9936ecc5ac2 /Mac/Tools/IDE/Wapplication.py | |
parent | c71efe01160653e1d232000889fe38f6cf4936c8 (diff) | |
download | cpython-git-815d2bf067799d519323a373387f342ec387645b.tar.gz |
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.
Diffstat (limited to 'Mac/Tools/IDE/Wapplication.py')
-rw-r--r-- | Mac/Tools/IDE/Wapplication.py | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/Mac/Tools/IDE/Wapplication.py b/Mac/Tools/IDE/Wapplication.py index 8839c90a8b..40eb0c67f3 100644 --- a/Mac/Tools/IDE/Wapplication.py +++ b/Mac/Tools/IDE/Wapplication.py @@ -28,27 +28,33 @@ class Application(FrameWork.Application): def mainloop(self, mask=FrameWork.everyEvent, wait=None): import W self.quitting = 0 - saveyield = MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + saveyield = MacOS.EnableAppswitch(-1) try: while not self.quitting: try: self.do1event(mask, wait) except W.AlertError, detail: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) W.Message(detail) except self.DebuggerQuit: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) except: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) import PyEdit PyEdit.tracebackwindow.traceback() finally: - MacOS.EnableAppswitch(1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(1) def debugger_mainloop(self, mask=FrameWork.everyEvent, wait=None): import W self.debugger_quitting = 0 - saveyield = MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + saveyield = MacOS.EnableAppswitch(-1) try: while not self.quitting and not self.debugger_quitting: try: @@ -59,7 +65,8 @@ class Application(FrameWork.Application): import PyEdit PyEdit.tracebackwindow.traceback() finally: - MacOS.EnableAppswitch(saveyield) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(saveyield) def breathe(self, wait=1): import W @@ -309,19 +316,24 @@ class Application(FrameWork.Application): # exec in that window's namespace. # xxx what to do when it's not saved??? # promt to save? - MacOS.EnableAppswitch(0) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(0) execfile(path, {'__name__': '__main__', '__file__': path}) except W.AlertError, detail: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) raise W.AlertError, detail except KeyboardInterrupt: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) except: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) import PyEdit PyEdit.tracebackwindow.traceback(1) else: - MacOS.EnableAppswitch(-1) + if hasattr(MacOS, 'EnableAppswitch'): + MacOS.EnableAppswitch(-1) #os.chdir(cwd) def openscript(self, filename, lineno=None, charoffset=0, modname=""): |