diff --git a/IPython/zmq/zmqshell.py b/IPython/zmq/zmqshell.py index af4a7b9..336c420 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/zmq/zmqshell.py @@ -1,8 +1,27 @@ +"""A ZMQ-based subclass of InteractiveShell. + +This code is meant to ease the refactoring of the base InteractiveShell into +something with a cleaner architecture for 2-process use, without actually +breaking InteractiveShell itself. So we're doing something a bit ugly, where +we subclass and override what we want to fix. Once this is working well, we +can go back to the base class and refactor the code for a cleaner inheritance +implementation that doesn't rely on so much monkeypatching. + +But this lets us maintain a fully working IPython as we develop the new +machinery. This should thus be thought of as scaffolding. +""" +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +# Stdlib import inspect +import os import re import sys + from subprocess import Popen, PIPE +# Our own from IPython.core.interactiveshell import ( InteractiveShell, InteractiveShellABC ) @@ -16,9 +35,16 @@ from IPython.zmq.session import extract_header from IPython.core.payloadpage import install_payload_page from session import Session +#----------------------------------------------------------------------------- +# Globals and side-effects +#----------------------------------------------------------------------------- + # Install the payload version of page. install_payload_page() +#----------------------------------------------------------------------------- +# Functions and classes +#----------------------------------------------------------------------------- class ZMQDisplayHook(DisplayHook): @@ -351,6 +377,10 @@ class ZMQInteractiveShell(InteractiveShell): filename = self.shell.mktempfile(data) print 'IPython will make a temporary file named:',filename + # Make sure we send to the client an absolute path, in case the working + # directory of client and kernel don't match + filename = os.path.abspath(filename) + payload = { 'source' : 'IPython.zmq.zmqshell.ZMQInteractiveShell.edit_magic', 'filename' : filename,