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:
Jack Jansen 2002-01-21 23:00:52 +00:00
parent c71efe0116
commit 815d2bf067
8 changed files with 71 additions and 38 deletions

View file

@ -75,9 +75,11 @@ class ConsoleTextWidget(W.EditText):
if char == Wkeys.returnkey:
text = self.get()[self._inputstart:selstart]
text = string.join(string.split(text, "\r"), "\n")
saveyield = MacOS.EnableAppswitch(0)
if hasattr(MacOS, 'EnableAppswitch'):
saveyield = MacOS.EnableAppswitch(0)
self.pyinteractive.executeline(text, self, self._namespace)
MacOS.EnableAppswitch(saveyield)
if hasattr(MacOS, 'EnableAppswitch'):
MacOS.EnableAppswitch(saveyield)
selstart, selend = self.getselection()
self._inputstart = selstart
@ -275,13 +277,15 @@ class PyOutput:
self.w.bind("<activate>", self.activate)
def write(self, text):
oldyield = MacOS.EnableAppswitch(-1)
if hasattr(MacOS, 'EnableAppswitch'):
oldyield = MacOS.EnableAppswitch(-1)
try:
self._buf = self._buf + text
if '\n' in self._buf:
self.flush()
finally:
MacOS.EnableAppswitch(oldyield)
if hasattr(MacOS, 'EnableAppswitch'):
MacOS.EnableAppswitch(oldyield)
def flush(self):
self.show()