diff --git a/IPython/core/payloadpage.py b/IPython/core/payloadpage.py index 39f57fa..f8436b1 100644 --- a/IPython/core/payloadpage.py +++ b/IPython/core/payloadpage.py @@ -82,7 +82,7 @@ def page(strng, start=0, screen_lines=0, pager_cmd=None, pass payload = dict( - source='IPython.zmq.page.page', + source='IPython.kernel.zmq.page.page', text=strng, html=html, start_line_number=start diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 798ec1d..52c2388 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -32,7 +32,7 @@ backends = {'tk': 'TkAgg', 'qt': 'Qt4Agg', # qt3 not supported 'qt4': 'Qt4Agg', 'osx': 'MacOSX', - 'inline' : 'module://IPython.zmq.pylab.backend_inline'} + 'inline' : 'module://IPython.kernel.zmq.pylab.backend_inline'} # We also need a reverse backends2guis mapping that will properly choose which # GUI support to activate based on the desired matplotlib backend. For the @@ -152,7 +152,7 @@ def select_figure_format(shell, fmt): Using this method ensures only one figure format is active at a time. """ from matplotlib.figure import Figure - from IPython.zmq.pylab import backend_inline + from IPython.kernel.zmq.pylab import backend_inline svg_formatter = shell.display_formatter.formatters['image/svg+xml'] png_formatter = shell.display_formatter.formatters['image/png'] @@ -188,7 +188,7 @@ def find_gui_and_backend(gui=None, gui_select=None): Returns ------- A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg', - 'WXAgg','Qt4Agg','module://IPython.zmq.pylab.backend_inline'). + 'WXAgg','Qt4Agg','module://IPython.kernel.zmq.pylab.backend_inline'). """ import matplotlib @@ -276,7 +276,7 @@ def configure_inline_support(shell, backend, user_ns=None): # continuing (such as in terminal-only shells in environments without # zeromq available). try: - from IPython.zmq.pylab.backend_inline import InlineBackend + from IPython.kernel.zmq.pylab.backend_inline import InlineBackend except ImportError: return from matplotlib import pyplot @@ -289,7 +289,7 @@ def configure_inline_support(shell, backend, user_ns=None): shell.configurables.append(cfg) if backend == backends['inline']: - from IPython.zmq.pylab.backend_inline import flush_figures + from IPython.kernel.zmq.pylab.backend_inline import flush_figures shell.register_post_execute(flush_figures) # Save rcParams that will be overwrittern @@ -301,7 +301,7 @@ def configure_inline_support(shell, backend, user_ns=None): # Add 'figsize' to pyplot and to the user's namespace user_ns['figsize'] = pyplot.figsize = figsize else: - from IPython.zmq.pylab.backend_inline import flush_figures + from IPython.kernel.zmq.pylab.backend_inline import flush_figures if flush_figures in shell._post_execute: shell._post_execute.pop(flush_figures) if hasattr(shell, '_saved_rcParams'): diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index fae471a..0cfff17 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -443,7 +443,7 @@ class TestModules(unittest.TestCase, tt.TempFileMixin): self.mktmp("import sys\n" "print('numpy' in sys.modules)\n" "print('IPython.parallel' in sys.modules)\n" - "print('IPython.zmq' in sys.modules)\n" + "print('IPython.kernel.zmq' in sys.modules)\n" ) out = "False\nFalse\nFalse\n" tt.ipexec_validate(self.fname, out) diff --git a/IPython/frontend/consoleapp.py b/IPython/frontend/consoleapp.py index aefbfed..8d76c10 100644 --- a/IPython/frontend/consoleapp.py +++ b/IPython/frontend/consoleapp.py @@ -42,13 +42,13 @@ from IPython.utils.py3compat import str_to_bytes from IPython.utils.traitlets import ( Dict, List, Unicode, CUnicode, Int, CBool, Any, CaselessStrEnum ) -from IPython.zmq.kernelapp import ( +from IPython.kernel.zmq.kernelapp import ( kernel_flags, kernel_aliases, IPKernelApp ) -from IPython.zmq.session import Session, default_secure -from IPython.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.session import Session, default_secure +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell #----------------------------------------------------------------------------- # Network Constants @@ -114,7 +114,7 @@ aliases.update(app_aliases) classes = [IPKernelApp, ZMQInteractiveShell, KernelManager, ProfileDir, Session] try: - from IPython.zmq.pylab.backend_inline import InlineBackend + from IPython.kernel.zmq.pylab.backend_inline import InlineBackend except ImportError: pass else: diff --git a/IPython/frontend/html/notebook/__init__.py b/IPython/frontend/html/notebook/__init__.py index bfa5317..c259d67 100644 --- a/IPython/frontend/html/notebook/__init__.py +++ b/IPython/frontend/html/notebook/__init__.py @@ -15,6 +15,6 @@ if version_info < (2,1,0): del msg # check for pyzmq 2.1.4 -from IPython.zmq import check_for_zmq +from IPython.kernel.zmq import check_for_zmq check_for_zmq('2.1.4', 'IPython.frontend.html.notebook') del check_for_zmq diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index 6dbaa65..628b121 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -36,7 +36,7 @@ from zmq.eventloop import ioloop from zmq.utils import jsonapi from IPython.external.decorator import decorator -from IPython.zmq.session import Session +from IPython.kernel.zmq.session import Session from IPython.lib.security import passwd_check from IPython.utils.jsonutil import date_default from IPython.utils.path import filefind diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index 1868103..3b4edb1 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -61,9 +61,9 @@ from IPython.config.application import catch_config_error, boolean_flag from IPython.core.application import BaseIPythonApplication from IPython.core.profiledir import ProfileDir from IPython.frontend.consoleapp import IPythonConsoleApp -from IPython.zmq.session import Session, default_secure -from IPython.zmq.zmqshell import ZMQInteractiveShell -from IPython.zmq.kernelapp import ( +from IPython.kernel.zmq.session import Session, default_secure +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.kernelapp import ( kernel_flags, kernel_aliases, IPKernelApp diff --git a/IPython/frontend/qt/console/ipython_widget.py b/IPython/frontend/qt/console/ipython_widget.py index d827e2d..06ceef7 100644 --- a/IPython/frontend/qt/console/ipython_widget.py +++ b/IPython/frontend/qt/console/ipython_widget.py @@ -38,7 +38,7 @@ default_output_sep = '' default_output_sep2 = '' # Base path for most payload sources. -zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell' +zmq_shell_source = 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell' if sys.platform.startswith('win'): default_editor = 'notepad' @@ -105,7 +105,7 @@ class IPythonWidget(FrontendWidget): _payload_source_edit = zmq_shell_source + '.edit_magic' _payload_source_exit = zmq_shell_source + '.ask_exit' _payload_source_next_input = zmq_shell_source + '.set_next_input' - _payload_source_page = 'IPython.zmq.page.page' + _payload_source_page = 'IPython.kernel.zmq.page.page' _retrying_history_request = False #--------------------------------------------------------------------------- diff --git a/IPython/frontend/qt/console/qtconsoleapp.py b/IPython/frontend/qt/console/qtconsoleapp.py index f0b711b..a7b219b 100644 --- a/IPython/frontend/qt/console/qtconsoleapp.py +++ b/IPython/frontend/qt/console/qtconsoleapp.py @@ -71,9 +71,9 @@ from IPython.utils.py3compat import str_to_bytes from IPython.utils.traitlets import ( Dict, List, Unicode, Integer, CaselessStrEnum, CBool, Any ) -from IPython.zmq.kernelapp import IPKernelApp -from IPython.zmq.session import Session, default_secure -from IPython.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.kernelapp import IPKernelApp +from IPython.kernel.zmq.session import Session, default_secure +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell from IPython.frontend.consoleapp import ( IPythonConsoleApp, app_aliases, app_flags, flags, aliases diff --git a/IPython/frontend/qt/console/rich_ipython_widget.py b/IPython/frontend/qt/console/rich_ipython_widget.py index ca5e620..368eb28 100644 --- a/IPython/frontend/qt/console/rich_ipython_widget.py +++ b/IPython/frontend/qt/console/rich_ipython_widget.py @@ -27,7 +27,7 @@ class RichIPythonWidget(IPythonWidget): """ # RichIPythonWidget protected class variables. - _payload_source_plot = 'IPython.zmq.pylab.backend_payload.add_plot_payload' + _payload_source_plot = 'IPython.kernel.zmq.pylab.backend_payload.add_plot_payload' _jpg_supported = Bool(False) # Used to determine whether a given html export attempt has already diff --git a/IPython/frontend/terminal/console/app.py b/IPython/frontend/terminal/console/app.py index f6ec15b..7606ef9 100644 --- a/IPython/frontend/terminal/console/app.py +++ b/IPython/frontend/terminal/console/app.py @@ -24,9 +24,9 @@ from IPython.utils.traitlets import ( ) from IPython.utils.warn import warn,error -from IPython.zmq.kernelapp import IPKernelApp -from IPython.zmq.session import Session, default_secure -from IPython.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.kernelapp import IPKernelApp +from IPython.kernel.zmq.session import Session, default_secure +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell from IPython.frontend.consoleapp import ( IPythonConsoleApp, app_aliases, app_flags, aliases, app_aliases, flags ) diff --git a/IPython/frontend/terminal/ipapp.py b/IPython/frontend/terminal/ipapp.py index dc09ef5..7d12247 100755 --- a/IPython/frontend/terminal/ipapp.py +++ b/IPython/frontend/terminal/ipapp.py @@ -233,7 +233,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): profile = ("IPython.core.profileapp.ProfileApp", "Create and manage IPython profiles." ), - kernel = ("IPython.zmq.kernelapp.IPKernelApp", + kernel = ("IPython.kernel.zmq.kernelapp.IPKernelApp", "Start a kernel without an attached frontend." ), console=('IPython.frontend.terminal.console.app.ZMQTerminalIPythonApp', diff --git a/IPython/inprocess/ipkernel.py b/IPython/inprocess/ipkernel.py index de60eb0..a5a3e28 100644 --- a/IPython/inprocess/ipkernel.py +++ b/IPython/inprocess/ipkernel.py @@ -21,8 +21,8 @@ from IPython.core.interactiveshell import InteractiveShellABC from IPython.inprocess.socket import DummySocket from IPython.utils.jsonutil import json_clean from IPython.utils.traitlets import Any, Enum, Instance, List, Type -from IPython.zmq.ipkernel import Kernel -from IPython.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.ipkernel import Kernel +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell #----------------------------------------------------------------------------- # Main kernel class @@ -131,18 +131,18 @@ class InProcessKernel(Kernel): return logging.getLogger(__name__) def _session_default(self): - from IPython.zmq.session import Session + from IPython.kernel.zmq.session import Session return Session(config=self.config) def _shell_class_default(self): return InProcessInteractiveShell def _stdout_default(self): - from IPython.zmq.iostream import OutStream + from IPython.kernel.zmq.iostream import OutStream return OutStream(self.session, self.iopub_socket, u'stdout') def _stderr_default(self): - from IPython.zmq.iostream import OutStream + from IPython.kernel.zmq.iostream import OutStream return OutStream(self.session, self.iopub_socket, u'stderr') #----------------------------------------------------------------------------- @@ -160,7 +160,7 @@ class InProcessInteractiveShell(ZMQInteractiveShell): def enable_gui(self, gui=None): """ Enable GUI integration for the kernel. """ - from IPython.zmq.eventloops import enable_gui + from IPython.kernel.zmq.eventloops import enable_gui if not gui: gui = self.kernel.gui enable_gui(gui, kernel=self.kernel) diff --git a/IPython/inprocess/kernelmanager.py b/IPython/inprocess/kernelmanager.py index 9d95a04..60021fd 100644 --- a/IPython/inprocess/kernelmanager.py +++ b/IPython/inprocess/kernelmanager.py @@ -191,9 +191,9 @@ class InProcessKernelManager(Configurable): """ # The Session to use for building messages. - session = Instance('IPython.zmq.session.Session') + session = Instance('IPython.kernel.zmq.session.Session') def _session_default(self): - from IPython.zmq.session import Session + from IPython.kernel.zmq.session import Session return Session(config=self.config) # The kernel process with which the KernelManager is communicating. diff --git a/IPython/kernel/connect.py b/IPython/kernel/connect.py index 7f3045c..98f3fc8 100644 --- a/IPython/kernel/connect.py +++ b/IPython/kernel/connect.py @@ -127,7 +127,7 @@ def get_connection_file(app=None): If unspecified, the currently running app will be used """ if app is None: - from IPython.zmq.kernelapp import IPKernelApp + from IPython.kernel.zmq.kernelapp import IPKernelApp if not IPKernelApp.initialized(): raise RuntimeError("app not specified, and not in a running Kernel") diff --git a/IPython/kernel/kernelmanager.py b/IPython/kernel/kernelmanager.py index 2f60c1a..daa6046 100644 --- a/IPython/kernel/kernelmanager.py +++ b/IPython/kernel/kernelmanager.py @@ -15,6 +15,8 @@ TODO # Imports #----------------------------------------------------------------------------- +from __future__ import absolute_import + # Standard library imports import atexit import errno @@ -45,7 +47,7 @@ from IPython.kernel import ( make_ipkernel_cmd, launch_kernel, ) -from IPython.zmq.session import Session +from IPython.kernel.zmq.session import Session from IPython.kernel import ( ShellChannelABC, IOPubChannelABC, HBChannelABC, StdInChannelABC, @@ -903,7 +905,7 @@ class KernelManager(Configurable): cmd = self.kernel_cmd else: cmd = make_ipkernel_cmd( - 'from IPython.zmq.kernelapp import main; main()', + 'from IPython.kernel.zmq.kernelapp import main; main()', **kw ) ns = dict(connection_file=self.connection_file) diff --git a/IPython/kernel/launcher.py b/IPython/kernel/launcher.py index 06b414d..4e40394 100644 --- a/IPython/kernel/launcher.py +++ b/IPython/kernel/launcher.py @@ -185,7 +185,7 @@ def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, # Spawn a kernel. if sys.platform == 'win32': - from IPython.zmq.parentpoller import ParentPollerWindows + from IPython.kernel.zmq.parentpoller import ParentPollerWindows # Create a Win32 event for interrupting the kernel. interrupt_event = ParentPollerWindows.create_interrupt_event() if ipython_kernel: diff --git a/IPython/kernel/multikernelmanager.py b/IPython/kernel/multikernelmanager.py index a9c6cbd..9b148ed 100644 --- a/IPython/kernel/multikernelmanager.py +++ b/IPython/kernel/multikernelmanager.py @@ -16,6 +16,8 @@ Authors: # Imports #----------------------------------------------------------------------------- +from __future__ import absolute_import + import os import uuid diff --git a/IPython/zmq/__init__.py b/IPython/kernel/zmq/__init__.py similarity index 97% rename from IPython/zmq/__init__.py rename to IPython/kernel/zmq/__init__.py index 9aa3d9f..87927ad 100644 --- a/IPython/zmq/__init__.py +++ b/IPython/kernel/zmq/__init__.py @@ -30,7 +30,7 @@ def patch_pyzmq(): jsonapi.jsonmod = json -def check_for_zmq(minimum_version, module='IPython.zmq'): +def check_for_zmq(minimum_version, module='IPython.kernel.zmq'): try: import zmq except ImportError: diff --git a/IPython/zmq/completer.py b/IPython/kernel/zmq/completer.py similarity index 100% rename from IPython/zmq/completer.py rename to IPython/kernel/zmq/completer.py diff --git a/IPython/zmq/datapub.py b/IPython/kernel/zmq/datapub.py similarity index 94% rename from IPython/zmq/datapub.py rename to IPython/kernel/zmq/datapub.py index 26a81d6..2bd8a30 100644 --- a/IPython/zmq/datapub.py +++ b/IPython/kernel/zmq/datapub.py @@ -16,8 +16,8 @@ from IPython.config import Configurable 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 -from IPython.zmq.session import Session, extract_header +from IPython.kernel.zmq.serialize import serialize_object +from IPython.kernel.zmq.session import Session, extract_header #----------------------------------------------------------------------------- # Code @@ -66,5 +66,5 @@ def publish_data(data): data : dict The data to be published. Think of it as a namespace. """ - from IPython.zmq.zmqshell import ZMQInteractiveShell + from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell ZMQInteractiveShell.instance().data_pub.publish_data(data) diff --git a/IPython/zmq/displayhook.py b/IPython/kernel/zmq/displayhook.py similarity index 100% rename from IPython/zmq/displayhook.py rename to IPython/kernel/zmq/displayhook.py diff --git a/IPython/zmq/embed.py b/IPython/kernel/zmq/embed.py similarity index 100% rename from IPython/zmq/embed.py rename to IPython/kernel/zmq/embed.py diff --git a/IPython/zmq/eventloops.py b/IPython/kernel/zmq/eventloops.py similarity index 100% rename from IPython/zmq/eventloops.py rename to IPython/kernel/zmq/eventloops.py diff --git a/IPython/zmq/frontend.py b/IPython/kernel/zmq/frontend.py similarity index 99% rename from IPython/zmq/frontend.py rename to IPython/kernel/zmq/frontend.py index 22f7b38..bd7f682 100755 --- a/IPython/zmq/frontend.py +++ b/IPython/kernel/zmq/frontend.py @@ -20,7 +20,7 @@ import zmq import session import completer from IPython.utils.localinterfaces import LOCALHOST -from IPython.zmq.session import Message +from IPython.kernel.zmq.session import Message #----------------------------------------------------------------------------- # Classes and functions diff --git a/IPython/zmq/gui/__init__.py b/IPython/kernel/zmq/gui/__init__.py similarity index 100% rename from IPython/zmq/gui/__init__.py rename to IPython/kernel/zmq/gui/__init__.py diff --git a/IPython/zmq/gui/gtkembed.py b/IPython/kernel/zmq/gui/gtkembed.py similarity index 100% rename from IPython/zmq/gui/gtkembed.py rename to IPython/kernel/zmq/gui/gtkembed.py diff --git a/IPython/zmq/heartbeat.py b/IPython/kernel/zmq/heartbeat.py similarity index 100% rename from IPython/zmq/heartbeat.py rename to IPython/kernel/zmq/heartbeat.py diff --git a/IPython/zmq/iostream.py b/IPython/kernel/zmq/iostream.py similarity index 100% rename from IPython/zmq/iostream.py rename to IPython/kernel/zmq/iostream.py diff --git a/IPython/zmq/ipkernel.py b/IPython/kernel/zmq/ipkernel.py similarity index 100% rename from IPython/zmq/ipkernel.py rename to IPython/kernel/zmq/ipkernel.py diff --git a/IPython/zmq/kernelapp.py b/IPython/kernel/zmq/kernelapp.py similarity index 94% rename from IPython/zmq/kernelapp.py rename to IPython/kernel/zmq/kernelapp.py index f1deb7b..9a2727c 100644 --- a/IPython/zmq/kernelapp.py +++ b/IPython/kernel/zmq/kernelapp.py @@ -108,11 +108,11 @@ class IPKernelApp(BaseIPythonApplication, InteractiveShellApp): flags = Dict(kernel_flags) classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session] # the kernel class, as an importstring - kernel_class = DottedObjectName('IPython.zmq.ipkernel.Kernel') + kernel_class = DottedObjectName('IPython.kernel.zmq.ipkernel.Kernel') kernel = Any() poller = Any() # don't restrict this even though current pollers are all Threads heartbeat = Instance(Heartbeat) - session = Instance('IPython.zmq.session.Session') + session = Instance('IPython.kernel.zmq.session.Session') ports = Dict() # inherit config file name from parent: @@ -159,9 +159,9 @@ class IPKernelApp(BaseIPythonApplication, InteractiveShellApp): # streams, etc. no_stdout = Bool(False, config=True, help="redirect stdout to the null device") no_stderr = Bool(False, config=True, help="redirect stderr to the null device") - outstream_class = DottedObjectName('IPython.zmq.iostream.OutStream', + outstream_class = DottedObjectName('IPython.kernel.zmq.iostream.OutStream', config=True, help="The importstring for the OutStream factory") - displayhook_class = DottedObjectName('IPython.zmq.displayhook.ZMQDisplayHook', + displayhook_class = DottedObjectName('IPython.kernel.zmq.displayhook.ZMQDisplayHook', config=True, help="The importstring for the DisplayHook factory") # polling diff --git a/IPython/zmq/log.py b/IPython/kernel/zmq/log.py similarity index 100% rename from IPython/zmq/log.py rename to IPython/kernel/zmq/log.py diff --git a/IPython/zmq/logtopics.rst b/IPython/kernel/zmq/logtopics.rst similarity index 100% rename from IPython/zmq/logtopics.rst rename to IPython/kernel/zmq/logtopics.rst diff --git a/IPython/zmq/parentpoller.py b/IPython/kernel/zmq/parentpoller.py similarity index 100% rename from IPython/zmq/parentpoller.py rename to IPython/kernel/zmq/parentpoller.py diff --git a/IPython/zmq/pylab/__init__.py b/IPython/kernel/zmq/pylab/__init__.py similarity index 100% rename from IPython/zmq/pylab/__init__.py rename to IPython/kernel/zmq/pylab/__init__.py diff --git a/IPython/zmq/pylab/backend_inline.py b/IPython/kernel/zmq/pylab/backend_inline.py similarity index 100% rename from IPython/zmq/pylab/backend_inline.py rename to IPython/kernel/zmq/pylab/backend_inline.py diff --git a/IPython/zmq/serialize.py b/IPython/kernel/zmq/serialize.py similarity index 100% rename from IPython/zmq/serialize.py rename to IPython/kernel/zmq/serialize.py diff --git a/IPython/zmq/session.py b/IPython/kernel/zmq/session.py similarity index 99% rename from IPython/zmq/session.py rename to IPython/kernel/zmq/session.py index 3fcff4f..91da4b3 100644 --- a/IPython/zmq/session.py +++ b/IPython/kernel/zmq/session.py @@ -50,7 +50,7 @@ from IPython.utils.jsonutil import extract_dates, squash_dates, date_default from IPython.utils.py3compat import str_to_bytes from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set, DottedObjectName, CUnicode, Dict, Integer) -from IPython.zmq.serialize import MAX_ITEMS, MAX_BYTES +from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES #----------------------------------------------------------------------------- # utility functions @@ -140,7 +140,7 @@ class SessionFactory(LoggingConfigurable): def _context_default(self): return zmq.Context.instance() - session = Instance('IPython.zmq.session.Session') + session = Instance('IPython.kernel.zmq.session.Session') loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=False) def _loop_default(self): diff --git a/IPython/zmq/tests/__init__.py b/IPython/kernel/zmq/tests/__init__.py similarity index 100% rename from IPython/zmq/tests/__init__.py rename to IPython/kernel/zmq/tests/__init__.py diff --git a/IPython/zmq/tests/test_embed_kernel.py b/IPython/kernel/zmq/tests/test_embed_kernel.py similarity index 100% rename from IPython/zmq/tests/test_embed_kernel.py rename to IPython/kernel/zmq/tests/test_embed_kernel.py diff --git a/IPython/zmq/tests/test_kernelmanager.py b/IPython/kernel/zmq/tests/test_kernelmanager.py similarity index 100% rename from IPython/zmq/tests/test_kernelmanager.py rename to IPython/kernel/zmq/tests/test_kernelmanager.py diff --git a/IPython/zmq/tests/test_serialize.py b/IPython/kernel/zmq/tests/test_serialize.py similarity index 99% rename from IPython/zmq/tests/test_serialize.py rename to IPython/kernel/zmq/tests/test_serialize.py index c8d5c7f..9afb9cc 100644 --- a/IPython/zmq/tests/test_serialize.py +++ b/IPython/kernel/zmq/tests/test_serialize.py @@ -16,7 +16,7 @@ import pickle import nose.tools as nt # from unittest import TestCaes -from IPython.zmq.serialize import serialize_object, unserialize_object +from IPython.kernel.zmq.serialize import serialize_object, unserialize_object from IPython.testing import decorators as dec from IPython.utils.pickleutil import CannedArray, CannedClass from IPython.parallel import interactive diff --git a/IPython/zmq/tests/test_session.py b/IPython/kernel/zmq/tests/test_session.py similarity index 99% rename from IPython/zmq/tests/test_session.py rename to IPython/kernel/zmq/tests/test_session.py index d22b33a..d039462 100644 --- a/IPython/zmq/tests/test_session.py +++ b/IPython/kernel/zmq/tests/test_session.py @@ -18,7 +18,7 @@ import zmq from zmq.tests import BaseZMQTestCase from zmq.eventloop.zmqstream import ZMQStream -from IPython.zmq import session as ss +from IPython.kernel.zmq import session as ss class SessionTestCase(BaseZMQTestCase): diff --git a/IPython/zmq/zmqshell.py b/IPython/kernel/zmq/zmqshell.py similarity index 96% rename from IPython/zmq/zmqshell.py rename to IPython/kernel/zmq/zmqshell.py index 35ff4d8..8bc7c0b 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/kernel/zmq/zmqshell.py @@ -45,9 +45,9 @@ from IPython.utils.process import arg_split from IPython.utils import py3compat from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes from IPython.utils.warn import warn, error -from IPython.zmq.displayhook import ZMQShellDisplayHook -from IPython.zmq.datapub import ZMQDataPublisher -from IPython.zmq.session import extract_header +from IPython.kernel.zmq.displayhook import ZMQShellDisplayHook +from IPython.kernel.zmq.datapub import ZMQDataPublisher +from IPython.kernel.zmq.session import extract_header from session import Session #----------------------------------------------------------------------------- @@ -171,7 +171,7 @@ class KernelMagics(Magics): # Send the payload back so that clients can modify their prompt display payload = dict( - source='IPython.zmq.zmqshell.ZMQInteractiveShell.doctest_mode', + source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.doctest_mode', mode=dstore.mode) shell.payload_manager.write_payload(payload) @@ -323,7 +323,7 @@ class KernelMagics(Magics): filename = os.path.abspath(filename) payload = { - 'source' : 'IPython.zmq.zmqshell.ZMQInteractiveShell.edit_magic', + 'source' : 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.edit_magic', 'filename' : filename, 'line_number' : lineno } @@ -525,7 +525,7 @@ class ZMQInteractiveShell(InteractiveShell): """ new = self.prompt_manager.render('rewrite') + cmd payload = dict( - source='IPython.zmq.zmqshell.ZMQInteractiveShell.auto_rewrite_input', + source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.auto_rewrite_input', transformed_input=new, ) self.payload_manager.write_payload(payload) @@ -534,7 +534,7 @@ class ZMQInteractiveShell(InteractiveShell): """Engage the exit actions.""" self.exit_now = True payload = dict( - source='IPython.zmq.zmqshell.ZMQInteractiveShell.ask_exit', + source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.ask_exit', exit=True, keepkernel=self.keepkernel_on_exit, ) @@ -572,7 +572,7 @@ class ZMQInteractiveShell(InteractiveShell): """Send the specified text to the frontend to be presented at the next input cell.""" payload = dict( - source='IPython.zmq.zmqshell.ZMQInteractiveShell.set_next_input', + source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.set_next_input', text=text ) self.payload_manager.write_payload(payload) diff --git a/IPython/parallel/__init__.py b/IPython/parallel/__init__.py index 0a58442..0692dd7 100644 --- a/IPython/parallel/__init__.py +++ b/IPython/parallel/__init__.py @@ -21,7 +21,7 @@ import warnings import zmq from IPython.config.configurable import MultipleInstanceError -from IPython.zmq import check_for_zmq +from IPython.kernel.zmq import check_for_zmq min_pyzmq = '2.1.11' @@ -50,7 +50,7 @@ def bind_kernel(**kwargs): This function returns immediately. """ - from IPython.zmq.kernelapp import IPKernelApp + from IPython.kernel.zmq.kernelapp import IPKernelApp from IPython.parallel.apps.ipengineapp import IPEngineApp # first check for IPKernelApp, in which case this should be a no-op diff --git a/IPython/parallel/apps/ipcontrollerapp.py b/IPython/parallel/apps/ipcontrollerapp.py index 822b396..0d8e0ae 100755 --- a/IPython/parallel/apps/ipcontrollerapp.py +++ b/IPython/parallel/apps/ipcontrollerapp.py @@ -47,7 +47,7 @@ from IPython.utils.importstring import import_item from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict, TraitError -from IPython.zmq.session import ( +from IPython.kernel.zmq.session import ( Session, session_aliases, session_flags, default_secure ) diff --git a/IPython/parallel/apps/ipengineapp.py b/IPython/parallel/apps/ipengineapp.py index 5cf6458..a3ec9e5 100755 --- a/IPython/parallel/apps/ipengineapp.py +++ b/IPython/parallel/apps/ipengineapp.py @@ -36,13 +36,13 @@ from IPython.parallel.apps.baseapp import ( base_flags, catch_config_error, ) -from IPython.zmq.log import EnginePUBHandler -from IPython.zmq.ipkernel import Kernel -from IPython.zmq.kernelapp import IPKernelApp -from IPython.zmq.session import ( +from IPython.kernel.zmq.log import EnginePUBHandler +from IPython.kernel.zmq.ipkernel import Kernel +from IPython.kernel.zmq.kernelapp import IPKernelApp +from IPython.kernel.zmq.session import ( Session, session_aliases, session_flags ) -from IPython.zmq.zmqshell import ZMQInteractiveShell +from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell from IPython.config.configurable import Configurable diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index dcc54f0..a6f0289 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -48,8 +48,8 @@ from IPython.parallel import Reference from IPython.parallel import error from IPython.parallel import util -from IPython.zmq.session import Session, Message -from IPython.zmq import serialize +from IPython.kernel.zmq.session import Session, Message +from IPython.kernel.zmq import serialize from .asyncresult import AsyncResult, AsyncHubResult from .view import DirectView, LoadBalancedView diff --git a/IPython/parallel/controller/hub.py b/IPython/parallel/controller/hub.py index 329c140..6ef7f7b 100644 --- a/IPython/parallel/controller/hub.py +++ b/IPython/parallel/controller/hub.py @@ -39,7 +39,7 @@ from IPython.utils.traitlets import ( from IPython.parallel import error, util from IPython.parallel.factory import RegistrationFactory -from IPython.zmq.session import SessionFactory +from IPython.kernel.zmq.session import SessionFactory from .heartmonitor import HeartMonitor diff --git a/IPython/parallel/engine/engine.py b/IPython/parallel/engine/engine.py index 295cfcb..69a7dce 100644 --- a/IPython/parallel/engine/engine.py +++ b/IPython/parallel/engine/engine.py @@ -34,20 +34,20 @@ from IPython.parallel.controller.heartmonitor import Heart from IPython.parallel.factory import RegistrationFactory from IPython.parallel.util import disambiguate_url -from IPython.zmq.session import Message -from IPython.zmq.ipkernel import Kernel -from IPython.zmq.kernelapp import IPKernelApp +from IPython.kernel.zmq.session import Message +from IPython.kernel.zmq.ipkernel import Kernel +from IPython.kernel.zmq.kernelapp import IPKernelApp class EngineFactory(RegistrationFactory): """IPython engine""" # configurables: - out_stream_factory=Type('IPython.zmq.iostream.OutStream', config=True, + out_stream_factory=Type('IPython.kernel.zmq.iostream.OutStream', config=True, help="""The OutStream for handling stdout/err. - Typically 'IPython.zmq.iostream.OutStream'""") - display_hook_factory=Type('IPython.zmq.displayhook.ZMQDisplayHook', config=True, + Typically 'IPython.kernel.zmq.iostream.OutStream'""") + display_hook_factory=Type('IPython.kernel.zmq.displayhook.ZMQDisplayHook', config=True, help="""The class for handling displayhook. - Typically 'IPython.zmq.displayhook.ZMQDisplayHook'""") + Typically 'IPython.kernel.zmq.displayhook.ZMQDisplayHook'""") location=Unicode(config=True, help="""The location (an IP address) of the controller. This is used for disambiguating URLs, to determine whether diff --git a/IPython/parallel/factory.py b/IPython/parallel/factory.py index 1617d01..3b2a770 100644 --- a/IPython/parallel/factory.py +++ b/IPython/parallel/factory.py @@ -28,7 +28,7 @@ from IPython.utils.localinterfaces import LOCALHOST from IPython.utils.traitlets import Integer, Instance, Unicode from IPython.parallel.util import select_random_ports -from IPython.zmq.session import Session, SessionFactory +from IPython.kernel.zmq.session import Session, SessionFactory #----------------------------------------------------------------------------- # Classes diff --git a/IPython/parallel/tests/test_asyncresult.py b/IPython/parallel/tests/test_asyncresult.py index a09a123..0c112a9 100644 --- a/IPython/parallel/tests/test_asyncresult.py +++ b/IPython/parallel/tests/test_asyncresult.py @@ -273,7 +273,7 @@ class AsyncResultTest(ClusterTestCase): v = self.client[-1] ar = v.execute('\n'.join([ "import time", - "from IPython.zmq.datapub import publish_data", + "from IPython.kernel.zmq.datapub import publish_data", "for i in range(5):", " publish_data(dict(i=i))", " time.sleep(0.1)", diff --git a/IPython/parallel/tests/test_db.py b/IPython/parallel/tests/test_db.py index d2e1bc3..8e95ad2 100644 --- a/IPython/parallel/tests/test_db.py +++ b/IPython/parallel/tests/test_db.py @@ -32,7 +32,7 @@ from IPython.parallel.controller.sqlitedb import SQLiteDB from IPython.parallel.controller.hub import init_record, empty_record from IPython.testing import decorators as dec -from IPython.zmq.session import Session +from IPython.kernel.zmq.session import Session #------------------------------------------------------------------------------- diff --git a/IPython/parallel/tests/test_view.py b/IPython/parallel/tests/test_view.py index 0007944..042fe9e 100644 --- a/IPython/parallel/tests/test_view.py +++ b/IPython/parallel/tests/test_view.py @@ -650,7 +650,7 @@ class TestView(ClusterTestCase, ParametricTestCase): def test_data_pub_single(self): view = self.client[-1] ar = view.execute('\n'.join([ - 'from IPython.zmq.datapub import publish_data', + 'from IPython.kernel.zmq.datapub import publish_data', 'for i in range(5):', ' publish_data(dict(i=i))' ]), block=False) @@ -661,7 +661,7 @@ class TestView(ClusterTestCase, ParametricTestCase): def test_data_pub(self): view = self.client[:] ar = view.execute('\n'.join([ - 'from IPython.zmq.datapub import publish_data', + 'from IPython.kernel.zmq.datapub import publish_data', 'for i in range(5):', ' publish_data(dict(i=i))' ]), block=False) diff --git a/IPython/parallel/util.py b/IPython/parallel/util.py index 714a035..dbb740f 100644 --- a/IPython/parallel/util.py +++ b/IPython/parallel/util.py @@ -44,8 +44,8 @@ from IPython.external.decorator import decorator # IPython imports from IPython.config.application import Application from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS -from IPython.zmq.log import EnginePUBHandler -from IPython.zmq.serialize import ( +from IPython.kernel.zmq.log import EnginePUBHandler +from IPython.kernel.zmq.serialize import ( unserialize_object, serialize_object, pack_apply_message, unpack_apply_message )