mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
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.
This commit is contained in:
parent
c71efe0116
commit
815d2bf067
8 changed files with 71 additions and 38 deletions
|
@ -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=""):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue