Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/PyShell.py @ 29256:b909fdf0edf8 legacy-trunk
Improved the RESTART annotation in the shell window when the user
restarts the shell while it is generating output. Also improved
annotation when user repeatedly hammers the Ctrl-F6 restart.
| author | Kurt B. Kaiser <kbk@shore.net> |
|---|---|
| date | Sat, 24 May 2003 21:12:46 +0000 |
| parents | be70b8477f43 |
| children | 8f73df099967 |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py Sat May 24 21:01:39 2003 +0000 +++ b/Lib/idlelib/PyShell.py Sat May 24 21:12:46 2003 +0000 @@ -311,6 +311,7 @@ locals = sys.modules['__main__'].__dict__ InteractiveInterpreter.__init__(self, locals=locals) self.save_warnings_filters = None + self.restarting = False port = 8833 rpcclt = None @@ -357,6 +358,9 @@ self.poll_subprocess() def restart_subprocess(self): + if self.restarting: + return + self.restarting = True # close only the subprocess debugger debug = self.getdebugger() if debug: @@ -369,12 +373,16 @@ self.rpcclt.close() self.unix_terminate() console = self.tkconsole + was_executing = console.executing console.executing = False self.spawn_subprocess() self.rpcclt.accept() self.transfer_path() # annotate restart in shell window and mark it console.text.delete("iomark", "end-1c") + if was_executing: + console.write('\n') + console.showprompt() halfbar = ((int(console.width) - 16) // 2) * '=' console.write(halfbar + ' RESTART ' + halfbar) console.text.mark_set("restart", "end-1c") @@ -386,6 +394,7 @@ gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt) # reload remote debugger breakpoints for all PyShellEditWindows debug.load_breakpoints() + self.restarting = False def __request_interrupt(self): self.rpcclt.remotecall("exec", "interrupt_the_server", (), {})
