more dead code removal

This commit is contained in:
Just van Rossum 2003-05-09 08:33:58 +00:00
parent 5ef0e7cc47
commit 476736eed6
1 changed files with 2 additions and 32 deletions

View File

@ -108,8 +108,6 @@ class Editor(W.Window):
self.run_as_main = self.settings.get("run_as_main", 0) self.run_as_main = self.settings.get("run_as_main", 0)
self.run_with_interpreter = self.settings.get("run_with_interpreter", 0) self.run_with_interpreter = self.settings.get("run_with_interpreter", 0)
self.run_with_cl_interpreter = self.settings.get("run_with_cl_interpreter", 0) self.run_with_cl_interpreter = self.settings.get("run_with_cl_interpreter", 0)
self._threadstate = (0, 0)
self._thread = None
def readwindowsettings(self): def readwindowsettings(self):
try: try:
@ -506,15 +504,7 @@ class Editor(W.Window):
self.runselbutton.push() self.runselbutton.push()
def run(self): def run(self):
if self._threadstate == (0, 0): self._run()
self._run()
else:
lock = Wthreading.Lock()
lock.acquire()
self._thread.postException(KeyboardInterrupt)
if self._thread.isBlocked():
self._thread.start()
lock.release()
def _run(self): def _run(self):
if self.run_with_interpreter: if self.run_with_interpreter:
@ -565,14 +555,7 @@ class Editor(W.Window):
t.do_script(with_command=cmd) t.do_script(with_command=cmd)
def runselection(self): def runselection(self):
if self._threadstate == (0, 0): self._runselection()
self._runselection()
elif self._threadstate == (1, 1):
self._thread.block()
self.setthreadstate((1, 2))
elif self._threadstate == (1, 2):
self._thread.start()
self.setthreadstate((1, 1))
def _runselection(self): def _runselection(self):
if self.run_with_interpreter or self.run_with_cl_interpreter: if self.run_with_interpreter or self.run_with_cl_interpreter:
@ -625,19 +608,6 @@ class Editor(W.Window):
klass.__dict__.update(globals[classname].__dict__) klass.__dict__.update(globals[classname].__dict__)
globals[classname] = klass globals[classname] = klass
def setthreadstate(self, state):
oldstate = self._threadstate
if oldstate[0] <> state[0]:
self.runbutton.settitle(runButtonLabels[state[0]])
if oldstate[1] <> state[1]:
self.runselbutton.settitle(runSelButtonLabels[state[1]])
self._threadstate = state
def _exec_threadwrapper(self, *args, **kwargs):
apply(execstring, args, kwargs)
self.setthreadstate((0, 0))
self._thread = None
def execstring(self, pytext, globals, locals, file, modname): def execstring(self, pytext, globals, locals, file, modname):
tracebackwindow.hide() tracebackwindow.hide()
# update windows # update windows