diff Lib/idlelib/PyShell.py @ 29353:b1395014714a legacy-trunk

Modify the remote stack viewer to work in the threaded subprocess. M PyShell.py M run.py
author Kurt B. Kaiser <kbk@shore.net>
date Mon, 02 Jun 2003 01:50:19 +0000
parents 4992c60d422b
children 72ce7cc03f27
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py	Sun Jun 01 20:57:12 2003 +0000
+++ b/Lib/idlelib/PyShell.py	Mon Jun 02 01:50:19 2003 +0000
@@ -357,6 +357,7 @@
         self.rpcclt.register("stderr", self.tkconsole.stderr)
         self.rpcclt.register("flist", self.tkconsole.flist)
         self.rpcclt.register("linecache", linecache)
+        self.rpcclt.register("interp", self)
         self.transfer_path()
         self.poll_subprocess()
 
@@ -480,6 +481,19 @@
     def getdebugger(self):
         return self.debugger
 
+    def open_remote_stack_viewer(self):
+        """Initiate the remote stack viewer from a separate thread.
+
+        This method is called from the subprocess, and by returning from this
+        method we allow the subprocess to unblock.  After a bit the shell
+        requests the subprocess to open the remote stack viewer which returns a
+        static object looking at the last exceptiopn.  It is queried through
+        the RPC mechanism.
+
+        """
+        self.tkconsole.text.after(300, self.remote_stack_viewer)
+        return
+
     def remote_stack_viewer(self):
         import RemoteObjectBrowser
         oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {})