Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

REFACTOR: Terminology change: 'embedded' -> 'in-process'.

  • Loading branch information...
commit bd40426d3bc0527d4a29845d93f65b54d11c3bf1 1 parent 20b2162
@epatters authored
View
2  IPython/frontend/qt/base_kernelmanager.py
@@ -34,7 +34,7 @@ def stop(self):
self.stopped.emit()
#---------------------------------------------------------------------------
- # EmbeddedChannel interface
+ # InProcessChannel interface
#---------------------------------------------------------------------------
def call_handlers_later(self, *args, **kwds):
View
33 IPython/frontend/qt/embedded_kernelmanager.py
@@ -1,33 +0,0 @@
-""" Defines an embedded KernelManager that provides signals and slots.
-"""
-
-# Local imports.
-from IPython.embedded.kernelmanager import \
- ShellEmbeddedChannel, SubEmbeddedChannel, StdInEmbeddedChannel, \
- HBEmbeddedChannel, EmbeddedKernelManager
-from IPython.utils.traitlets import Type
-from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
- QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
-
-
-class QtShellEmbeddedChannel(QtShellChannelMixin, ShellEmbeddedChannel):
- pass
-
-class QtSubEmbeddedChannel(QtSubChannelMixin, SubEmbeddedChannel):
- pass
-
-class QtStdInEmbeddedChannel(QtStdInChannelMixin, StdInEmbeddedChannel):
- pass
-
-class QtHBEmbeddedChannel(QtHBChannelMixin, HBEmbeddedChannel):
- pass
-
-
-class QtEmbeddedKernelManager(QtKernelManagerMixin, EmbeddedKernelManager):
- """ An embedded KernelManager that provides signals and slots.
- """
-
- sub_channel_class = Type(QtSubEmbeddedChannel)
- shell_channel_class = Type(QtShellEmbeddedChannel)
- stdin_channel_class = Type(QtStdInEmbeddedChannel)
- hb_channel_class = Type(QtHBEmbeddedChannel)
View
33 IPython/frontend/qt/inprocess_kernelmanager.py
@@ -0,0 +1,33 @@
+""" Defines an in-process KernelManager with signals and slots.
+"""
+
+# Local imports.
+from IPython.inprocess.kernelmanager import \
+ ShellInProcessChannel, SubInProcessChannel, StdInInProcessChannel, \
+ HBInProcessChannel, InProcessKernelManager
+from IPython.utils.traitlets import Type
+from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
+ QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
+
+
+class QtShellInProcessChannel(QtShellChannelMixin, ShellInProcessChannel):
+ pass
+
+class QtSubInProcessChannel(QtSubChannelMixin, SubInProcessChannel):
+ pass
+
+class QtStdInInProcessChannel(QtStdInChannelMixin, StdInInProcessChannel):
+ pass
+
+class QtHBInProcessChannel(QtHBChannelMixin, HBInProcessChannel):
+ pass
+
+
+class QtInProcessKernelManager(QtKernelManagerMixin, InProcessKernelManager):
+ """ An in-process KernelManager with signals and slots.
+ """
+
+ sub_channel_class = Type(QtSubInProcessChannel)
+ shell_channel_class = Type(QtShellInProcessChannel)
+ stdin_channel_class = Type(QtStdInInProcessChannel)
+ hb_channel_class = Type(QtHBInProcessChannel)
View
0  IPython/embedded/__init__.py → IPython/inprocess/__init__.py
File renamed without changes
View
18 IPython/embedded/blockingkernelmanager.py → IPython/inprocess/blockingkernelmanager.py
@@ -20,8 +20,8 @@
# Local imports.
from IPython.utils.traitlets import Type
-from kernelmanager import EmbeddedKernelManager, ShellEmbeddedChannel, \
- SubEmbeddedChannel, StdInEmbeddedChannel
+from kernelmanager import InProcessKernelManager, ShellInProcessChannel, \
+ SubInProcessChannel, StdInInProcessChannel
#-----------------------------------------------------------------------------
# Utility classes
@@ -58,18 +58,18 @@ def msg_ready(self):
# Blocking kernel manager
#-----------------------------------------------------------------------------
-class BlockingShellEmbeddedChannel(BlockingChannelMixin, ShellEmbeddedChannel):
+class BlockingShellInProcessChannel(BlockingChannelMixin, ShellInProcessChannel):
pass
-class BlockingSubEmbeddedChannel(BlockingChannelMixin, SubEmbeddedChannel):
+class BlockingSubInProcessChannel(BlockingChannelMixin, SubInProcessChannel):
pass
-class BlockingStdInEmbeddedChannel(BlockingChannelMixin, StdInEmbeddedChannel):
+class BlockingStdInInProcessChannel(BlockingChannelMixin, StdInInProcessChannel):
pass
-class BlockingEmbeddedKernelManager(EmbeddedKernelManager):
+class BlockingInProcessKernelManager(InProcessKernelManager):
# The classes to use for the various channels.
- shell_channel_class = Type(BlockingShellEmbeddedChannel)
- sub_channel_class = Type(BlockingSubEmbeddedChannel)
- stdin_channel_class = Type(BlockingStdInEmbeddedChannel)
+ shell_channel_class = Type(BlockingShellInProcessChannel)
+ sub_channel_class = Type(BlockingSubInProcessChannel)
+ stdin_channel_class = Type(BlockingStdInInProcessChannel)
View
16 IPython/embedded/ipkernel.py → IPython/inprocess/ipkernel.py
@@ -1,4 +1,4 @@
-""" An embedded (in-process) kernel. """
+""" An in-process kernel. """
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
@@ -17,7 +17,7 @@
import sys
# Local imports.
-from IPython.embedded.socket import DummySocket
+from IPython.inprocess.socket import DummySocket
from IPython.utils.jsonutil import json_clean
from IPython.utils.traitlets import Any, Instance, List
from IPython.zmq.ipkernel import Kernel
@@ -26,14 +26,14 @@
# Main kernel class
#-----------------------------------------------------------------------------
-class EmbeddedKernel(Kernel):
+class InProcessKernel(Kernel):
#-------------------------------------------------------------------------
- # EmbeddedKernel interface
+ # InProcessKernel interface
#-------------------------------------------------------------------------
frontends = List(
- Instance('IPython.embedded.kernelmanager.EmbeddedKernelManager'))
+ Instance('IPython.inprocess.kernelmanager.InProcessKernelManager'))
raw_input_str = Any()
stdout = Any()
@@ -52,21 +52,21 @@ def __init__(self, **traits):
# When an InteractiveShell is instantiated by our base class, it binds
# the current values of sys.stdout and sys.stderr.
with self._redirected_io():
- super(EmbeddedKernel, self).__init__(**traits)
+ super(InProcessKernel, self).__init__(**traits)
self.iopub_socket.on_trait_change(self._io_dispatch, 'message_sent')
def execute_request(self, stream, ident, parent):
""" Override for temporary IO redirection. """
with self._redirected_io():
- super(EmbeddedKernel, self).execute_request(stream, ident, parent)
+ super(InProcessKernel, self).execute_request(stream, ident, parent)
def start(self):
""" Override registration of dispatchers for streams. """
self.shell.exit_now = False
def _abort_queue(self, stream):
- """ The embedded kernel don't abort requests. """
+ """ The in-process kernel doesn't abort requests. """
pass
def _raw_input(self, prompt, ident, parent):
View
50 IPython/embedded/kernelmanager.py → IPython/inprocess/kernelmanager.py
@@ -1,4 +1,4 @@
-""" A kernel manager for embedded (in-process) kernels. """
+""" A kernel manager for in-process kernels. """
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
@@ -13,19 +13,19 @@
# Local imports.
from IPython.config.loader import Config
-from IPython.embedded.socket import DummySocket
+from IPython.inprocess.socket import DummySocket
from IPython.utils.traitlets import HasTraits, Any, Instance, Type
#-----------------------------------------------------------------------------
# Channel classes
#-----------------------------------------------------------------------------
-class EmbeddedChannel(object):
- """ Base class for embedded channels.
+class InProcessChannel(object):
+ """ Base class for in-process channels.
"""
def __init__(self, manager):
- super(EmbeddedChannel, self).__init__()
+ super(InProcessChannel, self).__init__()
self.manager = manager
self._is_alive = False
@@ -50,7 +50,7 @@ def call_handlers(self, msg):
raise NotImplementedError('call_handlers must be defined in a subclass.')
#--------------------------------------------------------------------------
- # EmbeddedChannel interface
+ # InProcessChannel interface
#--------------------------------------------------------------------------
def call_handlers_later(self, *args, **kwds):
@@ -71,7 +71,7 @@ def process_events(self):
raise NotImplementedError
-class ShellEmbeddedChannel(EmbeddedChannel):
+class ShellInProcessChannel(InProcessChannel):
"""The DEALER channel for issues request/replies to the kernel.
"""
@@ -215,10 +215,10 @@ def history(self, raw=True, output=False, hist_access_type='range', **kwds):
def shutdown(self, restart=False):
""" Request an immediate kernel shutdown.
- A dummy method for the embedded kernel.
+ A dummy method for the in-process kernel.
"""
# FIXME: What to do here?
- raise NotImplementedError('Shutdown not supported for embedded kernel')
+ raise NotImplementedError('Cannot shutdown in-process kernel')
#--------------------------------------------------------------------------
# Protected interface
@@ -240,19 +240,19 @@ def _dispatch_to_kernel(self, msg):
self.call_handlers_later(reply_msg)
-class SubEmbeddedChannel(EmbeddedChannel):
+class SubInProcessChannel(InProcessChannel):
"""The SUB channel which listens for messages that the kernel publishes.
"""
def flush(self, timeout=1.0):
""" Immediately processes all pending messages on the SUB channel.
- A dummy method for the embedded kernel.
+ A dummy method for the in-process kernel.
"""
pass
-class StdInEmbeddedChannel(EmbeddedChannel):
+class StdInInProcessChannel(InProcessChannel):
""" A reply channel to handle raw_input requests that the kernel makes. """
def input(self, string):
@@ -264,13 +264,13 @@ def input(self, string):
kernel.raw_input_str = string
-class HBEmbeddedChannel(EmbeddedChannel):
+class HBInProcessChannel(InProcessChannel):
""" A dummy heartbeat channel. """
time_to_dead = 3.0
def __init__(self, *args, **kwds):
- super(HBEmbeddedChannel, self).__init__(*args, **kwds)
+ super(HBInProcessChannel, self).__init__(*args, **kwds)
self._pause = True
def pause(self):
@@ -290,8 +290,8 @@ def is_beating(self):
# Main kernel manager class
#-----------------------------------------------------------------------------
-class EmbeddedKernelManager(HasTraits):
- """ A manager for an embedded kernel.
+class InProcessKernelManager(HasTraits):
+ """ A manager for an in-process kernel.
This class implements most of the interface of
``IPython.zmq.kernelmanager.KernelManager`` and allows (asynchronous)
@@ -307,13 +307,13 @@ def _session_default(self):
return Session(config=self.config)
# The kernel process with which the KernelManager is communicating.
- kernel = Instance('IPython.embedded.ipkernel.EmbeddedKernel')
+ kernel = Instance('IPython.inprocess.ipkernel.InProcessKernel')
# The classes to use for the various channels.
- shell_channel_class = Type(ShellEmbeddedChannel)
- sub_channel_class = Type(SubEmbeddedChannel)
- stdin_channel_class = Type(StdInEmbeddedChannel)
- hb_channel_class = Type(HBEmbeddedChannel)
+ shell_channel_class = Type(ShellInProcessChannel)
+ sub_channel_class = Type(SubInProcessChannel)
+ stdin_channel_class = Type(StdInInProcessChannel)
+ hb_channel_class = Type(HBInProcessChannel)
# Protected traits.
_shell_channel = Any
@@ -365,8 +365,8 @@ def channels_running(self):
def start_kernel(self, **kwds):
""" Starts a kernel process and configures the manager to use it.
"""
- from IPython.embedded.ipkernel import EmbeddedKernel
- self.kernel = EmbeddedKernel()
+ from IPython.inprocess.ipkernel import InProcessKernel
+ self.kernel = InProcessKernel()
self.kernel.frontends.append(self)
def shutdown_kernel(self):
@@ -398,11 +398,11 @@ def kill_kernel(self):
def interrupt_kernel(self):
""" Interrupts the kernel. """
- raise NotImplementedError("Cannot interrupt embedded kernel.")
+ raise NotImplementedError("Cannot interrupt in-process kernel.")
def signal_kernel(self, signum):
""" Sends a signal to the kernel. """
- raise NotImplementedError("Cannot signal embedded kernel.")
+ raise NotImplementedError("Cannot signal in-process kernel.")
@property
def is_alive(self):
View
0  IPython/embedded/socket.py → IPython/inprocess/socket.py
File renamed without changes
View
2  IPython/zmq/blockingkernelmanager.py
@@ -14,7 +14,7 @@
#-----------------------------------------------------------------------------
# Local imports.
-from IPython.embedded.blockingkernelmanager import BlockingChannelMixin
+from IPython.inprocess.blockingkernelmanager import BlockingChannelMixin
from IPython.utils.traitlets import Type
from kernelmanager import KernelManager, SubSocketChannel, HBSocketChannel, \
ShellSocketChannel, StdInSocketChannel
View
2  IPython/zmq/datapub.py
@@ -13,7 +13,7 @@
#-----------------------------------------------------------------------------
from IPython.config import Configurable
-from IPython.embedded.socket import SocketABC
+from IPython.inprocess.socket import SocketABC
from IPython.utils.jsonutil import json_clean
from IPython.utils.traitlets import Instance, Dict, CBytes
from IPython.zmq.serialize import serialize_object
View
2  IPython/zmq/displayhook.py
@@ -2,7 +2,7 @@
import sys
from IPython.core.displayhook import DisplayHook
-from IPython.embedded.socket import SocketABC
+from IPython.inprocess.socket import SocketABC
from IPython.utils.jsonutil import encode_images
from IPython.utils.traitlets import Instance, Dict
from session import extract_header, Session
View
2  IPython/zmq/zmqshell.py
@@ -34,7 +34,7 @@
from IPython.core.magics import MacroToEdit, CodeMagics
from IPython.core.magic import magics_class, line_magic, Magics
from IPython.core.payloadpage import install_payload_page
-from IPython.embedded.socket import SocketABC
+from IPython.inprocess.socket import SocketABC
from IPython.lib.kernel import (
get_connection_file, get_connection_info, connect_qtconsole
)
View
8 docs/examples/frontend/embedded_qtconsole.py → docs/examples/frontend/inprocess_qtconsole.py
@@ -1,6 +1,6 @@
-from IPython.embedded.ipkernel import EmbeddedKernel
+from IPython.inprocess.ipkernel import InProcessKernel
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
-from IPython.frontend.qt.embedded_kernelmanager import QtEmbeddedKernelManager
+from IPython.frontend.qt.inprocess_kernelmanager import QtInProcessKernelManager
from IPython.lib import guisupport
@@ -8,11 +8,11 @@ def main():
app = guisupport.get_app_qt4()
# Create a kernel and populate the namespace.
- kernel = EmbeddedKernel()
+ kernel = InProcessKernel()
kernel.shell.push({'x': 0, 'y': 1, 'z': 2})
# Create a kernel manager for the frontend and register it with the kernel.
- km = QtEmbeddedKernelManager(kernel=kernel)
+ km = QtInProcessKernelManager(kernel=kernel)
km.start_channels()
kernel.frontends.append(km)
Please sign in to comment.
Something went wrong with that request. Please try again.