[Idle-dev] CVS: idle PyShell.py,1.69,1.70

Kurt B. Kaiser kbk@users.sourceforge.net
Sat, 24 May 2003 14:12:49 -0700


Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv10063

Modified Files:
	PyShell.py 
Log Message:
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.


Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -r1.69 -r1.70
*** PyShell.py	24 May 2003 20:59:12 -0000	1.69
--- PyShell.py	24 May 2003 21:12:46 -0000	1.70
***************
*** 312,315 ****
--- 312,316 ----
          InteractiveInterpreter.__init__(self, locals=locals)
          self.save_warnings_filters = None
+         self.restarting = False
  
      port = 8833
***************
*** 358,361 ****
--- 359,365 ----
  
      def restart_subprocess(self):
+         if self.restarting:
+             return
+         self.restarting = True
          # close only the subprocess debugger
          debug = self.getdebugger()
***************
*** 370,373 ****
--- 374,378 ----
          self.unix_terminate()
          console = self.tkconsole
+         was_executing = console.executing
          console.executing = False
          self.spawn_subprocess()
***************
*** 376,379 ****
--- 381,387 ----
          # 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)
***************
*** 387,390 ****
--- 395,399 ----
              # reload remote debugger breakpoints for all PyShellEditWindows
              debug.load_breakpoints()
+         self.restarting = False
  
      def __request_interrupt(self):