Exemplo n.º 1
0
 def restart_subprocess(self):
     if self.restarting:
         return self.rpcclt
     self.restarting = True
     # close only the subprocess debugger
     debug = self.getdebugger()
     if debug:
         try:
             # Only close subprocess debugger, don't unregister gui_adap!
             RemoteDebugger.close_subprocess_debugger(self.rpcclt)
         except:
             pass
     # Kill subprocess, spawn a new one, accept connection.
     self.rpcclt.close()
     self.unix_terminate()
     console = self.tkconsole
     was_executing = console.executing
     console.executing = False
     self.spawn_subprocess()
     try:
         self.rpcclt.accept()
     except socket.timeout as err:
         self.display_no_subprocess_error()
         return None
     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")
     console.text.mark_gravity("restart", "left")
     console.showprompt()
     # restart subprocess debugger
     if debug:
         # Restarted debugger connects to current instance of debug GUI
         gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
         # reload remote debugger breakpoints for all PyShellEditWindows
         debug.load_breakpoints()
     self.restarting = False
     return self.rpcclt
Exemplo n.º 2
0
 def restart_subprocess(self):
     if self.restarting:
         return self.rpcclt
     self.restarting = True
     # close only the subprocess debugger
     debug = self.getdebugger()
     if debug:
         try:
             # Only close subprocess debugger, don't unregister gui_adap!
             RemoteDebugger.close_subprocess_debugger(self.rpcclt)
         except:
             pass
     # Kill subprocess, spawn a new one, accept connection.
     self.rpcclt.close()
     self.unix_terminate()
     console = self.tkconsole
     was_executing = console.executing
     console.executing = False
     self.spawn_subprocess()
     try:
         self.rpcclt.accept()
     except socket.timeout as err:
         self.display_no_subprocess_error()
         return None
     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")
     console.text.mark_gravity("restart", "left")
     console.showprompt()
     # restart subprocess debugger
     if debug:
         # Restarted debugger connects to current instance of debug GUI
         gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
         # reload remote debugger breakpoints for all PyShellEditWindows
         debug.load_breakpoints()
     self.restarting = False
     return self.rpcclt
Exemplo n.º 3
0
    def restart_subprocess(self, with_cwd = False):
        if self.restarting:
            return self.rpcclt
        else:
            self.restarting = True
            debug = self.getdebugger()
            if debug:
                try:
                    RemoteDebugger.close_subprocess_debugger(self.rpcclt)
                except:
                    pass

            self.rpcclt.close()
            self.unix_terminate()
            console = self.tkconsole
            was_executing = console.executing
            console.executing = False
            self.spawn_subprocess()
            try:
                self.rpcclt.accept()
            except socket.timeout as err:
                self.display_no_subprocess_error()
                return None

            self.transfer_path(with_cwd=with_cwd)
            console.stop_readline()
            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')
            console.text.mark_gravity('restart', 'left')
            console.showprompt()
            if debug:
                gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
                debug.load_breakpoints()
            self.compile.compiler.flags = self.original_compiler_flags
            self.restarting = False
            return self.rpcclt
Exemplo n.º 4
0
    def restart_subprocess(self):
        if self.restarting:
            return self.rpcclt
        else:
            self.restarting = True
            debug = self.getdebugger()
            if debug:
                try:
                    RemoteDebugger.close_subprocess_debugger(self.rpcclt)
                except:
                    pass

            self.rpcclt.close()
            self.unix_terminate()
            console = self.tkconsole
            was_executing = console.executing
            console.executing = False
            self.spawn_subprocess()
            try:
                self.rpcclt.accept()
            except socket.timeout as err:
                self.display_no_subprocess_error()
                return None

            self.transfer_path()
            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')
            console.text.mark_gravity('restart', 'left')
            console.showprompt()
            if debug:
                gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
                debug.load_breakpoints()
            self.restarting = False
            return self.rpcclt
Exemplo n.º 5
0
 def restart_subprocess(self):
     if self.restarting:
         return self.rpcclt
     self.restarting = True
     # close only the subprocess debugger
     debug = self.getdebugger()
     if debug:
         try:
             # Only close subprocess debugger, don't unregister gui_adap!
             RemoteDebugger.close_subprocess_debugger(self.rpcclt)
         except:
             pass
     # Kill subprocess, spawn a new one, accept connection.
     self.rpcclt.close()
     self.unix_terminate()
     console = self.tkconsole
     was_executing = console.executing
     console.executing = False
     self.spawn_subprocess()
     try:
         self.rpcclt.accept()
     except socket.timeout, err:
         self.display_no_subprocess_error()
         return None