##// END OF EJS Templates
mv IPython.zmq to IPython.kernel.zmq
MinRK -
Show More
@@ -82,7 +82,7 b' def page(strng, start=0, screen_lines=0, pager_cmd=None,'
82 pass
82 pass
83
83
84 payload = dict(
84 payload = dict(
85 source='IPython.zmq.page.page',
85 source='IPython.kernel.zmq.page.page',
86 text=strng,
86 text=strng,
87 html=html,
87 html=html,
88 start_line_number=start
88 start_line_number=start
@@ -32,7 +32,7 b" backends = {'tk': 'TkAgg',"
32 'qt': 'Qt4Agg', # qt3 not supported
32 'qt': 'Qt4Agg', # qt3 not supported
33 'qt4': 'Qt4Agg',
33 'qt4': 'Qt4Agg',
34 'osx': 'MacOSX',
34 'osx': 'MacOSX',
35 'inline' : 'module://IPython.zmq.pylab.backend_inline'}
35 'inline' : 'module://IPython.kernel.zmq.pylab.backend_inline'}
36
36
37 # We also need a reverse backends2guis mapping that will properly choose which
37 # We also need a reverse backends2guis mapping that will properly choose which
38 # GUI support to activate based on the desired matplotlib backend. For the
38 # GUI support to activate based on the desired matplotlib backend. For the
@@ -152,7 +152,7 b' def select_figure_format(shell, fmt):'
152 Using this method ensures only one figure format is active at a time.
152 Using this method ensures only one figure format is active at a time.
153 """
153 """
154 from matplotlib.figure import Figure
154 from matplotlib.figure import Figure
155 from IPython.zmq.pylab import backend_inline
155 from IPython.kernel.zmq.pylab import backend_inline
156
156
157 svg_formatter = shell.display_formatter.formatters['image/svg+xml']
157 svg_formatter = shell.display_formatter.formatters['image/svg+xml']
158 png_formatter = shell.display_formatter.formatters['image/png']
158 png_formatter = shell.display_formatter.formatters['image/png']
@@ -188,7 +188,7 b' def find_gui_and_backend(gui=None, gui_select=None):'
188 Returns
188 Returns
189 -------
189 -------
190 A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg',
190 A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg',
191 'WXAgg','Qt4Agg','module://IPython.zmq.pylab.backend_inline').
191 'WXAgg','Qt4Agg','module://IPython.kernel.zmq.pylab.backend_inline').
192 """
192 """
193
193
194 import matplotlib
194 import matplotlib
@@ -276,7 +276,7 b' def configure_inline_support(shell, backend, user_ns=None):'
276 # continuing (such as in terminal-only shells in environments without
276 # continuing (such as in terminal-only shells in environments without
277 # zeromq available).
277 # zeromq available).
278 try:
278 try:
279 from IPython.zmq.pylab.backend_inline import InlineBackend
279 from IPython.kernel.zmq.pylab.backend_inline import InlineBackend
280 except ImportError:
280 except ImportError:
281 return
281 return
282 from matplotlib import pyplot
282 from matplotlib import pyplot
@@ -289,7 +289,7 b' def configure_inline_support(shell, backend, user_ns=None):'
289 shell.configurables.append(cfg)
289 shell.configurables.append(cfg)
290
290
291 if backend == backends['inline']:
291 if backend == backends['inline']:
292 from IPython.zmq.pylab.backend_inline import flush_figures
292 from IPython.kernel.zmq.pylab.backend_inline import flush_figures
293 shell.register_post_execute(flush_figures)
293 shell.register_post_execute(flush_figures)
294
294
295 # Save rcParams that will be overwrittern
295 # Save rcParams that will be overwrittern
@@ -301,7 +301,7 b' def configure_inline_support(shell, backend, user_ns=None):'
301 # Add 'figsize' to pyplot and to the user's namespace
301 # Add 'figsize' to pyplot and to the user's namespace
302 user_ns['figsize'] = pyplot.figsize = figsize
302 user_ns['figsize'] = pyplot.figsize = figsize
303 else:
303 else:
304 from IPython.zmq.pylab.backend_inline import flush_figures
304 from IPython.kernel.zmq.pylab.backend_inline import flush_figures
305 if flush_figures in shell._post_execute:
305 if flush_figures in shell._post_execute:
306 shell._post_execute.pop(flush_figures)
306 shell._post_execute.pop(flush_figures)
307 if hasattr(shell, '_saved_rcParams'):
307 if hasattr(shell, '_saved_rcParams'):
@@ -443,7 +443,7 b' class TestModules(unittest.TestCase, tt.TempFileMixin):'
443 self.mktmp("import sys\n"
443 self.mktmp("import sys\n"
444 "print('numpy' in sys.modules)\n"
444 "print('numpy' in sys.modules)\n"
445 "print('IPython.parallel' in sys.modules)\n"
445 "print('IPython.parallel' in sys.modules)\n"
446 "print('IPython.zmq' in sys.modules)\n"
446 "print('IPython.kernel.zmq' in sys.modules)\n"
447 )
447 )
448 out = "False\nFalse\nFalse\n"
448 out = "False\nFalse\nFalse\n"
449 tt.ipexec_validate(self.fname, out)
449 tt.ipexec_validate(self.fname, out)
@@ -42,13 +42,13 b' from IPython.utils.py3compat import str_to_bytes'
42 from IPython.utils.traitlets import (
42 from IPython.utils.traitlets import (
43 Dict, List, Unicode, CUnicode, Int, CBool, Any, CaselessStrEnum
43 Dict, List, Unicode, CUnicode, Int, CBool, Any, CaselessStrEnum
44 )
44 )
45 from IPython.zmq.kernelapp import (
45 from IPython.kernel.zmq.kernelapp import (
46 kernel_flags,
46 kernel_flags,
47 kernel_aliases,
47 kernel_aliases,
48 IPKernelApp
48 IPKernelApp
49 )
49 )
50 from IPython.zmq.session import Session, default_secure
50 from IPython.kernel.zmq.session import Session, default_secure
51 from IPython.zmq.zmqshell import ZMQInteractiveShell
51 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
52
52
53 #-----------------------------------------------------------------------------
53 #-----------------------------------------------------------------------------
54 # Network Constants
54 # Network Constants
@@ -114,7 +114,7 b' aliases.update(app_aliases)'
114 classes = [IPKernelApp, ZMQInteractiveShell, KernelManager, ProfileDir, Session]
114 classes = [IPKernelApp, ZMQInteractiveShell, KernelManager, ProfileDir, Session]
115
115
116 try:
116 try:
117 from IPython.zmq.pylab.backend_inline import InlineBackend
117 from IPython.kernel.zmq.pylab.backend_inline import InlineBackend
118 except ImportError:
118 except ImportError:
119 pass
119 pass
120 else:
120 else:
@@ -15,6 +15,6 b' if version_info < (2,1,0):'
15 del msg
15 del msg
16
16
17 # check for pyzmq 2.1.4
17 # check for pyzmq 2.1.4
18 from IPython.zmq import check_for_zmq
18 from IPython.kernel.zmq import check_for_zmq
19 check_for_zmq('2.1.4', 'IPython.frontend.html.notebook')
19 check_for_zmq('2.1.4', 'IPython.frontend.html.notebook')
20 del check_for_zmq
20 del check_for_zmq
@@ -36,7 +36,7 b' from zmq.eventloop import ioloop'
36 from zmq.utils import jsonapi
36 from zmq.utils import jsonapi
37
37
38 from IPython.external.decorator import decorator
38 from IPython.external.decorator import decorator
39 from IPython.zmq.session import Session
39 from IPython.kernel.zmq.session import Session
40 from IPython.lib.security import passwd_check
40 from IPython.lib.security import passwd_check
41 from IPython.utils.jsonutil import date_default
41 from IPython.utils.jsonutil import date_default
42 from IPython.utils.path import filefind
42 from IPython.utils.path import filefind
@@ -61,9 +61,9 b' from IPython.config.application import catch_config_error, boolean_flag'
61 from IPython.core.application import BaseIPythonApplication
61 from IPython.core.application import BaseIPythonApplication
62 from IPython.core.profiledir import ProfileDir
62 from IPython.core.profiledir import ProfileDir
63 from IPython.frontend.consoleapp import IPythonConsoleApp
63 from IPython.frontend.consoleapp import IPythonConsoleApp
64 from IPython.zmq.session import Session, default_secure
64 from IPython.kernel.zmq.session import Session, default_secure
65 from IPython.zmq.zmqshell import ZMQInteractiveShell
65 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
66 from IPython.zmq.kernelapp import (
66 from IPython.kernel.zmq.kernelapp import (
67 kernel_flags,
67 kernel_flags,
68 kernel_aliases,
68 kernel_aliases,
69 IPKernelApp
69 IPKernelApp
@@ -38,7 +38,7 b" default_output_sep = ''"
38 default_output_sep2 = ''
38 default_output_sep2 = ''
39
39
40 # Base path for most payload sources.
40 # Base path for most payload sources.
41 zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell'
41 zmq_shell_source = 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell'
42
42
43 if sys.platform.startswith('win'):
43 if sys.platform.startswith('win'):
44 default_editor = 'notepad'
44 default_editor = 'notepad'
@@ -105,7 +105,7 b' class IPythonWidget(FrontendWidget):'
105 _payload_source_edit = zmq_shell_source + '.edit_magic'
105 _payload_source_edit = zmq_shell_source + '.edit_magic'
106 _payload_source_exit = zmq_shell_source + '.ask_exit'
106 _payload_source_exit = zmq_shell_source + '.ask_exit'
107 _payload_source_next_input = zmq_shell_source + '.set_next_input'
107 _payload_source_next_input = zmq_shell_source + '.set_next_input'
108 _payload_source_page = 'IPython.zmq.page.page'
108 _payload_source_page = 'IPython.kernel.zmq.page.page'
109 _retrying_history_request = False
109 _retrying_history_request = False
110
110
111 #---------------------------------------------------------------------------
111 #---------------------------------------------------------------------------
@@ -71,9 +71,9 b' from IPython.utils.py3compat import str_to_bytes'
71 from IPython.utils.traitlets import (
71 from IPython.utils.traitlets import (
72 Dict, List, Unicode, Integer, CaselessStrEnum, CBool, Any
72 Dict, List, Unicode, Integer, CaselessStrEnum, CBool, Any
73 )
73 )
74 from IPython.zmq.kernelapp import IPKernelApp
74 from IPython.kernel.zmq.kernelapp import IPKernelApp
75 from IPython.zmq.session import Session, default_secure
75 from IPython.kernel.zmq.session import Session, default_secure
76 from IPython.zmq.zmqshell import ZMQInteractiveShell
76 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
77
77
78 from IPython.frontend.consoleapp import (
78 from IPython.frontend.consoleapp import (
79 IPythonConsoleApp, app_aliases, app_flags, flags, aliases
79 IPythonConsoleApp, app_aliases, app_flags, flags, aliases
@@ -27,7 +27,7 b' class RichIPythonWidget(IPythonWidget):'
27 """
27 """
28
28
29 # RichIPythonWidget protected class variables.
29 # RichIPythonWidget protected class variables.
30 _payload_source_plot = 'IPython.zmq.pylab.backend_payload.add_plot_payload'
30 _payload_source_plot = 'IPython.kernel.zmq.pylab.backend_payload.add_plot_payload'
31 _jpg_supported = Bool(False)
31 _jpg_supported = Bool(False)
32
32
33 # Used to determine whether a given html export attempt has already
33 # Used to determine whether a given html export attempt has already
@@ -24,9 +24,9 b' from IPython.utils.traitlets import ('
24 )
24 )
25 from IPython.utils.warn import warn,error
25 from IPython.utils.warn import warn,error
26
26
27 from IPython.zmq.kernelapp import IPKernelApp
27 from IPython.kernel.zmq.kernelapp import IPKernelApp
28 from IPython.zmq.session import Session, default_secure
28 from IPython.kernel.zmq.session import Session, default_secure
29 from IPython.zmq.zmqshell import ZMQInteractiveShell
29 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
30 from IPython.frontend.consoleapp import (
30 from IPython.frontend.consoleapp import (
31 IPythonConsoleApp, app_aliases, app_flags, aliases, app_aliases, flags
31 IPythonConsoleApp, app_aliases, app_flags, aliases, app_aliases, flags
32 )
32 )
@@ -233,7 +233,7 b' class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):'
233 profile = ("IPython.core.profileapp.ProfileApp",
233 profile = ("IPython.core.profileapp.ProfileApp",
234 "Create and manage IPython profiles."
234 "Create and manage IPython profiles."
235 ),
235 ),
236 kernel = ("IPython.zmq.kernelapp.IPKernelApp",
236 kernel = ("IPython.kernel.zmq.kernelapp.IPKernelApp",
237 "Start a kernel without an attached frontend."
237 "Start a kernel without an attached frontend."
238 ),
238 ),
239 console=('IPython.frontend.terminal.console.app.ZMQTerminalIPythonApp',
239 console=('IPython.frontend.terminal.console.app.ZMQTerminalIPythonApp',
@@ -21,8 +21,8 b' from IPython.core.interactiveshell import InteractiveShellABC'
21 from IPython.inprocess.socket import DummySocket
21 from IPython.inprocess.socket import DummySocket
22 from IPython.utils.jsonutil import json_clean
22 from IPython.utils.jsonutil import json_clean
23 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
23 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
24 from IPython.zmq.ipkernel import Kernel
24 from IPython.kernel.zmq.ipkernel import Kernel
25 from IPython.zmq.zmqshell import ZMQInteractiveShell
25 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
26
26
27 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
28 # Main kernel class
28 # Main kernel class
@@ -131,18 +131,18 b' class InProcessKernel(Kernel):'
131 return logging.getLogger(__name__)
131 return logging.getLogger(__name__)
132
132
133 def _session_default(self):
133 def _session_default(self):
134 from IPython.zmq.session import Session
134 from IPython.kernel.zmq.session import Session
135 return Session(config=self.config)
135 return Session(config=self.config)
136
136
137 def _shell_class_default(self):
137 def _shell_class_default(self):
138 return InProcessInteractiveShell
138 return InProcessInteractiveShell
139
139
140 def _stdout_default(self):
140 def _stdout_default(self):
141 from IPython.zmq.iostream import OutStream
141 from IPython.kernel.zmq.iostream import OutStream
142 return OutStream(self.session, self.iopub_socket, u'stdout')
142 return OutStream(self.session, self.iopub_socket, u'stdout')
143
143
144 def _stderr_default(self):
144 def _stderr_default(self):
145 from IPython.zmq.iostream import OutStream
145 from IPython.kernel.zmq.iostream import OutStream
146 return OutStream(self.session, self.iopub_socket, u'stderr')
146 return OutStream(self.session, self.iopub_socket, u'stderr')
147
147
148 #-----------------------------------------------------------------------------
148 #-----------------------------------------------------------------------------
@@ -160,7 +160,7 b' class InProcessInteractiveShell(ZMQInteractiveShell):'
160 def enable_gui(self, gui=None):
160 def enable_gui(self, gui=None):
161 """ Enable GUI integration for the kernel.
161 """ Enable GUI integration for the kernel.
162 """
162 """
163 from IPython.zmq.eventloops import enable_gui
163 from IPython.kernel.zmq.eventloops import enable_gui
164 if not gui:
164 if not gui:
165 gui = self.kernel.gui
165 gui = self.kernel.gui
166 enable_gui(gui, kernel=self.kernel)
166 enable_gui(gui, kernel=self.kernel)
@@ -191,9 +191,9 b' class InProcessKernelManager(Configurable):'
191 """
191 """
192
192
193 # The Session to use for building messages.
193 # The Session to use for building messages.
194 session = Instance('IPython.zmq.session.Session')
194 session = Instance('IPython.kernel.zmq.session.Session')
195 def _session_default(self):
195 def _session_default(self):
196 from IPython.zmq.session import Session
196 from IPython.kernel.zmq.session import Session
197 return Session(config=self.config)
197 return Session(config=self.config)
198
198
199 # The kernel process with which the KernelManager is communicating.
199 # The kernel process with which the KernelManager is communicating.
@@ -127,7 +127,7 b' def get_connection_file(app=None):'
127 If unspecified, the currently running app will be used
127 If unspecified, the currently running app will be used
128 """
128 """
129 if app is None:
129 if app is None:
130 from IPython.zmq.kernelapp import IPKernelApp
130 from IPython.kernel.zmq.kernelapp import IPKernelApp
131 if not IPKernelApp.initialized():
131 if not IPKernelApp.initialized():
132 raise RuntimeError("app not specified, and not in a running Kernel")
132 raise RuntimeError("app not specified, and not in a running Kernel")
133
133
@@ -15,6 +15,8 b' TODO'
15 # Imports
15 # Imports
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17
17
18 from __future__ import absolute_import
19
18 # Standard library imports
20 # Standard library imports
19 import atexit
21 import atexit
20 import errno
22 import errno
@@ -45,7 +47,7 b' from IPython.kernel import ('
45 make_ipkernel_cmd,
47 make_ipkernel_cmd,
46 launch_kernel,
48 launch_kernel,
47 )
49 )
48 from IPython.zmq.session import Session
50 from IPython.kernel.zmq.session import Session
49 from IPython.kernel import (
51 from IPython.kernel import (
50 ShellChannelABC, IOPubChannelABC,
52 ShellChannelABC, IOPubChannelABC,
51 HBChannelABC, StdInChannelABC,
53 HBChannelABC, StdInChannelABC,
@@ -903,7 +905,7 b' class KernelManager(Configurable):'
903 cmd = self.kernel_cmd
905 cmd = self.kernel_cmd
904 else:
906 else:
905 cmd = make_ipkernel_cmd(
907 cmd = make_ipkernel_cmd(
906 'from IPython.zmq.kernelapp import main; main()',
908 'from IPython.kernel.zmq.kernelapp import main; main()',
907 **kw
909 **kw
908 )
910 )
909 ns = dict(connection_file=self.connection_file)
911 ns = dict(connection_file=self.connection_file)
@@ -185,7 +185,7 b' def launch_kernel(cmd, stdin=None, stdout=None, stderr=None,'
185
185
186 # Spawn a kernel.
186 # Spawn a kernel.
187 if sys.platform == 'win32':
187 if sys.platform == 'win32':
188 from IPython.zmq.parentpoller import ParentPollerWindows
188 from IPython.kernel.zmq.parentpoller import ParentPollerWindows
189 # Create a Win32 event for interrupting the kernel.
189 # Create a Win32 event for interrupting the kernel.
190 interrupt_event = ParentPollerWindows.create_interrupt_event()
190 interrupt_event = ParentPollerWindows.create_interrupt_event()
191 if ipython_kernel:
191 if ipython_kernel:
@@ -16,6 +16,8 b' Authors:'
16 # Imports
16 # Imports
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18
18
19 from __future__ import absolute_import
20
19 import os
21 import os
20 import uuid
22 import uuid
21
23
@@ -30,7 +30,7 b' def patch_pyzmq():'
30 jsonapi.jsonmod = json
30 jsonapi.jsonmod = json
31
31
32
32
33 def check_for_zmq(minimum_version, module='IPython.zmq'):
33 def check_for_zmq(minimum_version, module='IPython.kernel.zmq'):
34 try:
34 try:
35 import zmq
35 import zmq
36 except ImportError:
36 except ImportError:
1 NO CONTENT: file renamed from IPython/zmq/completer.py to IPython/kernel/zmq/completer.py
NO CONTENT: file renamed from IPython/zmq/completer.py to IPython/kernel/zmq/completer.py
@@ -16,8 +16,8 b' from IPython.config import Configurable'
16 from IPython.inprocess.socket import SocketABC
16 from IPython.inprocess.socket import SocketABC
17 from IPython.utils.jsonutil import json_clean
17 from IPython.utils.jsonutil import json_clean
18 from IPython.utils.traitlets import Instance, Dict, CBytes
18 from IPython.utils.traitlets import Instance, Dict, CBytes
19 from IPython.zmq.serialize import serialize_object
19 from IPython.kernel.zmq.serialize import serialize_object
20 from IPython.zmq.session import Session, extract_header
20 from IPython.kernel.zmq.session import Session, extract_header
21
21
22 #-----------------------------------------------------------------------------
22 #-----------------------------------------------------------------------------
23 # Code
23 # Code
@@ -66,5 +66,5 b' def publish_data(data):'
66 data : dict
66 data : dict
67 The data to be published. Think of it as a namespace.
67 The data to be published. Think of it as a namespace.
68 """
68 """
69 from IPython.zmq.zmqshell import ZMQInteractiveShell
69 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
70 ZMQInteractiveShell.instance().data_pub.publish_data(data)
70 ZMQInteractiveShell.instance().data_pub.publish_data(data)
1 NO CONTENT: file renamed from IPython/zmq/displayhook.py to IPython/kernel/zmq/displayhook.py
NO CONTENT: file renamed from IPython/zmq/displayhook.py to IPython/kernel/zmq/displayhook.py
1 NO CONTENT: file renamed from IPython/zmq/embed.py to IPython/kernel/zmq/embed.py
NO CONTENT: file renamed from IPython/zmq/embed.py to IPython/kernel/zmq/embed.py
1 NO CONTENT: file renamed from IPython/zmq/eventloops.py to IPython/kernel/zmq/eventloops.py
NO CONTENT: file renamed from IPython/zmq/eventloops.py to IPython/kernel/zmq/eventloops.py
@@ -20,7 +20,7 b' import zmq'
20 import session
20 import session
21 import completer
21 import completer
22 from IPython.utils.localinterfaces import LOCALHOST
22 from IPython.utils.localinterfaces import LOCALHOST
23 from IPython.zmq.session import Message
23 from IPython.kernel.zmq.session import Message
24
24
25 #-----------------------------------------------------------------------------
25 #-----------------------------------------------------------------------------
26 # Classes and functions
26 # Classes and functions
1 NO CONTENT: file renamed from IPython/zmq/gui/__init__.py to IPython/kernel/zmq/gui/__init__.py
NO CONTENT: file renamed from IPython/zmq/gui/__init__.py to IPython/kernel/zmq/gui/__init__.py
1 NO CONTENT: file renamed from IPython/zmq/gui/gtkembed.py to IPython/kernel/zmq/gui/gtkembed.py
NO CONTENT: file renamed from IPython/zmq/gui/gtkembed.py to IPython/kernel/zmq/gui/gtkembed.py
1 NO CONTENT: file renamed from IPython/zmq/heartbeat.py to IPython/kernel/zmq/heartbeat.py
NO CONTENT: file renamed from IPython/zmq/heartbeat.py to IPython/kernel/zmq/heartbeat.py
1 NO CONTENT: file renamed from IPython/zmq/iostream.py to IPython/kernel/zmq/iostream.py
NO CONTENT: file renamed from IPython/zmq/iostream.py to IPython/kernel/zmq/iostream.py
1 NO CONTENT: file renamed from IPython/zmq/ipkernel.py to IPython/kernel/zmq/ipkernel.py
NO CONTENT: file renamed from IPython/zmq/ipkernel.py to IPython/kernel/zmq/ipkernel.py
@@ -108,11 +108,11 b' class IPKernelApp(BaseIPythonApplication, InteractiveShellApp):'
108 flags = Dict(kernel_flags)
108 flags = Dict(kernel_flags)
109 classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session]
109 classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session]
110 # the kernel class, as an importstring
110 # the kernel class, as an importstring
111 kernel_class = DottedObjectName('IPython.zmq.ipkernel.Kernel')
111 kernel_class = DottedObjectName('IPython.kernel.zmq.ipkernel.Kernel')
112 kernel = Any()
112 kernel = Any()
113 poller = Any() # don't restrict this even though current pollers are all Threads
113 poller = Any() # don't restrict this even though current pollers are all Threads
114 heartbeat = Instance(Heartbeat)
114 heartbeat = Instance(Heartbeat)
115 session = Instance('IPython.zmq.session.Session')
115 session = Instance('IPython.kernel.zmq.session.Session')
116 ports = Dict()
116 ports = Dict()
117
117
118 # inherit config file name from parent:
118 # inherit config file name from parent:
@@ -159,9 +159,9 b' class IPKernelApp(BaseIPythonApplication, InteractiveShellApp):'
159 # streams, etc.
159 # streams, etc.
160 no_stdout = Bool(False, config=True, help="redirect stdout to the null device")
160 no_stdout = Bool(False, config=True, help="redirect stdout to the null device")
161 no_stderr = Bool(False, config=True, help="redirect stderr to the null device")
161 no_stderr = Bool(False, config=True, help="redirect stderr to the null device")
162 outstream_class = DottedObjectName('IPython.zmq.iostream.OutStream',
162 outstream_class = DottedObjectName('IPython.kernel.zmq.iostream.OutStream',
163 config=True, help="The importstring for the OutStream factory")
163 config=True, help="The importstring for the OutStream factory")
164 displayhook_class = DottedObjectName('IPython.zmq.displayhook.ZMQDisplayHook',
164 displayhook_class = DottedObjectName('IPython.kernel.zmq.displayhook.ZMQDisplayHook',
165 config=True, help="The importstring for the DisplayHook factory")
165 config=True, help="The importstring for the DisplayHook factory")
166
166
167 # polling
167 # polling
1 NO CONTENT: file renamed from IPython/zmq/log.py to IPython/kernel/zmq/log.py
NO CONTENT: file renamed from IPython/zmq/log.py to IPython/kernel/zmq/log.py
1 NO CONTENT: file renamed from IPython/zmq/logtopics.rst to IPython/kernel/zmq/logtopics.rst
NO CONTENT: file renamed from IPython/zmq/logtopics.rst to IPython/kernel/zmq/logtopics.rst
1 NO CONTENT: file renamed from IPython/zmq/parentpoller.py to IPython/kernel/zmq/parentpoller.py
NO CONTENT: file renamed from IPython/zmq/parentpoller.py to IPython/kernel/zmq/parentpoller.py
1 NO CONTENT: file renamed from IPython/zmq/pylab/__init__.py to IPython/kernel/zmq/pylab/__init__.py
NO CONTENT: file renamed from IPython/zmq/pylab/__init__.py to IPython/kernel/zmq/pylab/__init__.py
1 NO CONTENT: file renamed from IPython/zmq/pylab/backend_inline.py to IPython/kernel/zmq/pylab/backend_inline.py
NO CONTENT: file renamed from IPython/zmq/pylab/backend_inline.py to IPython/kernel/zmq/pylab/backend_inline.py
1 NO CONTENT: file renamed from IPython/zmq/serialize.py to IPython/kernel/zmq/serialize.py
NO CONTENT: file renamed from IPython/zmq/serialize.py to IPython/kernel/zmq/serialize.py
@@ -50,7 +50,7 b' from IPython.utils.jsonutil import extract_dates, squash_dates, date_default'
50 from IPython.utils.py3compat import str_to_bytes
50 from IPython.utils.py3compat import str_to_bytes
51 from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set,
51 from IPython.utils.traitlets import (CBytes, Unicode, Bool, Any, Instance, Set,
52 DottedObjectName, CUnicode, Dict, Integer)
52 DottedObjectName, CUnicode, Dict, Integer)
53 from IPython.zmq.serialize import MAX_ITEMS, MAX_BYTES
53 from IPython.kernel.zmq.serialize import MAX_ITEMS, MAX_BYTES
54
54
55 #-----------------------------------------------------------------------------
55 #-----------------------------------------------------------------------------
56 # utility functions
56 # utility functions
@@ -140,7 +140,7 b' class SessionFactory(LoggingConfigurable):'
140 def _context_default(self):
140 def _context_default(self):
141 return zmq.Context.instance()
141 return zmq.Context.instance()
142
142
143 session = Instance('IPython.zmq.session.Session')
143 session = Instance('IPython.kernel.zmq.session.Session')
144
144
145 loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=False)
145 loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=False)
146 def _loop_default(self):
146 def _loop_default(self):
1 NO CONTENT: file renamed from IPython/zmq/tests/__init__.py to IPython/kernel/zmq/tests/__init__.py
NO CONTENT: file renamed from IPython/zmq/tests/__init__.py to IPython/kernel/zmq/tests/__init__.py
1 NO CONTENT: file renamed from IPython/zmq/tests/test_embed_kernel.py to IPython/kernel/zmq/tests/test_embed_kernel.py
NO CONTENT: file renamed from IPython/zmq/tests/test_embed_kernel.py to IPython/kernel/zmq/tests/test_embed_kernel.py
1 NO CONTENT: file renamed from IPython/zmq/tests/test_kernelmanager.py to IPython/kernel/zmq/tests/test_kernelmanager.py
NO CONTENT: file renamed from IPython/zmq/tests/test_kernelmanager.py to IPython/kernel/zmq/tests/test_kernelmanager.py
@@ -16,7 +16,7 b' import pickle'
16 import nose.tools as nt
16 import nose.tools as nt
17
17
18 # from unittest import TestCaes
18 # from unittest import TestCaes
19 from IPython.zmq.serialize import serialize_object, unserialize_object
19 from IPython.kernel.zmq.serialize import serialize_object, unserialize_object
20 from IPython.testing import decorators as dec
20 from IPython.testing import decorators as dec
21 from IPython.utils.pickleutil import CannedArray, CannedClass
21 from IPython.utils.pickleutil import CannedArray, CannedClass
22 from IPython.parallel import interactive
22 from IPython.parallel import interactive
@@ -18,7 +18,7 b' import zmq'
18 from zmq.tests import BaseZMQTestCase
18 from zmq.tests import BaseZMQTestCase
19 from zmq.eventloop.zmqstream import ZMQStream
19 from zmq.eventloop.zmqstream import ZMQStream
20
20
21 from IPython.zmq import session as ss
21 from IPython.kernel.zmq import session as ss
22
22
23 class SessionTestCase(BaseZMQTestCase):
23 class SessionTestCase(BaseZMQTestCase):
24
24
@@ -45,9 +45,9 b' from IPython.utils.process import arg_split'
45 from IPython.utils import py3compat
45 from IPython.utils import py3compat
46 from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes
46 from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes
47 from IPython.utils.warn import warn, error
47 from IPython.utils.warn import warn, error
48 from IPython.zmq.displayhook import ZMQShellDisplayHook
48 from IPython.kernel.zmq.displayhook import ZMQShellDisplayHook
49 from IPython.zmq.datapub import ZMQDataPublisher
49 from IPython.kernel.zmq.datapub import ZMQDataPublisher
50 from IPython.zmq.session import extract_header
50 from IPython.kernel.zmq.session import extract_header
51 from session import Session
51 from session import Session
52
52
53 #-----------------------------------------------------------------------------
53 #-----------------------------------------------------------------------------
@@ -171,7 +171,7 b' class KernelMagics(Magics):'
171
171
172 # Send the payload back so that clients can modify their prompt display
172 # Send the payload back so that clients can modify their prompt display
173 payload = dict(
173 payload = dict(
174 source='IPython.zmq.zmqshell.ZMQInteractiveShell.doctest_mode',
174 source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.doctest_mode',
175 mode=dstore.mode)
175 mode=dstore.mode)
176 shell.payload_manager.write_payload(payload)
176 shell.payload_manager.write_payload(payload)
177
177
@@ -323,7 +323,7 b' class KernelMagics(Magics):'
323 filename = os.path.abspath(filename)
323 filename = os.path.abspath(filename)
324
324
325 payload = {
325 payload = {
326 'source' : 'IPython.zmq.zmqshell.ZMQInteractiveShell.edit_magic',
326 'source' : 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.edit_magic',
327 'filename' : filename,
327 'filename' : filename,
328 'line_number' : lineno
328 'line_number' : lineno
329 }
329 }
@@ -525,7 +525,7 b' class ZMQInteractiveShell(InteractiveShell):'
525 """
525 """
526 new = self.prompt_manager.render('rewrite') + cmd
526 new = self.prompt_manager.render('rewrite') + cmd
527 payload = dict(
527 payload = dict(
528 source='IPython.zmq.zmqshell.ZMQInteractiveShell.auto_rewrite_input',
528 source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.auto_rewrite_input',
529 transformed_input=new,
529 transformed_input=new,
530 )
530 )
531 self.payload_manager.write_payload(payload)
531 self.payload_manager.write_payload(payload)
@@ -534,7 +534,7 b' class ZMQInteractiveShell(InteractiveShell):'
534 """Engage the exit actions."""
534 """Engage the exit actions."""
535 self.exit_now = True
535 self.exit_now = True
536 payload = dict(
536 payload = dict(
537 source='IPython.zmq.zmqshell.ZMQInteractiveShell.ask_exit',
537 source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.ask_exit',
538 exit=True,
538 exit=True,
539 keepkernel=self.keepkernel_on_exit,
539 keepkernel=self.keepkernel_on_exit,
540 )
540 )
@@ -572,7 +572,7 b' class ZMQInteractiveShell(InteractiveShell):'
572 """Send the specified text to the frontend to be presented at the next
572 """Send the specified text to the frontend to be presented at the next
573 input cell."""
573 input cell."""
574 payload = dict(
574 payload = dict(
575 source='IPython.zmq.zmqshell.ZMQInteractiveShell.set_next_input',
575 source='IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.set_next_input',
576 text=text
576 text=text
577 )
577 )
578 self.payload_manager.write_payload(payload)
578 self.payload_manager.write_payload(payload)
@@ -21,7 +21,7 b' import warnings'
21 import zmq
21 import zmq
22
22
23 from IPython.config.configurable import MultipleInstanceError
23 from IPython.config.configurable import MultipleInstanceError
24 from IPython.zmq import check_for_zmq
24 from IPython.kernel.zmq import check_for_zmq
25
25
26 min_pyzmq = '2.1.11'
26 min_pyzmq = '2.1.11'
27
27
@@ -50,7 +50,7 b' def bind_kernel(**kwargs):'
50
50
51 This function returns immediately.
51 This function returns immediately.
52 """
52 """
53 from IPython.zmq.kernelapp import IPKernelApp
53 from IPython.kernel.zmq.kernelapp import IPKernelApp
54 from IPython.parallel.apps.ipengineapp import IPEngineApp
54 from IPython.parallel.apps.ipengineapp import IPEngineApp
55
55
56 # first check for IPKernelApp, in which case this should be a no-op
56 # first check for IPKernelApp, in which case this should be a no-op
@@ -47,7 +47,7 b' from IPython.utils.importstring import import_item'
47 from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS
47 from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS
48 from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict, TraitError
48 from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict, TraitError
49
49
50 from IPython.zmq.session import (
50 from IPython.kernel.zmq.session import (
51 Session, session_aliases, session_flags, default_secure
51 Session, session_aliases, session_flags, default_secure
52 )
52 )
53
53
@@ -36,13 +36,13 b' from IPython.parallel.apps.baseapp import ('
36 base_flags,
36 base_flags,
37 catch_config_error,
37 catch_config_error,
38 )
38 )
39 from IPython.zmq.log import EnginePUBHandler
39 from IPython.kernel.zmq.log import EnginePUBHandler
40 from IPython.zmq.ipkernel import Kernel
40 from IPython.kernel.zmq.ipkernel import Kernel
41 from IPython.zmq.kernelapp import IPKernelApp
41 from IPython.kernel.zmq.kernelapp import IPKernelApp
42 from IPython.zmq.session import (
42 from IPython.kernel.zmq.session import (
43 Session, session_aliases, session_flags
43 Session, session_aliases, session_flags
44 )
44 )
45 from IPython.zmq.zmqshell import ZMQInteractiveShell
45 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
46
46
47 from IPython.config.configurable import Configurable
47 from IPython.config.configurable import Configurable
48
48
@@ -48,8 +48,8 b' from IPython.parallel import Reference'
48 from IPython.parallel import error
48 from IPython.parallel import error
49 from IPython.parallel import util
49 from IPython.parallel import util
50
50
51 from IPython.zmq.session import Session, Message
51 from IPython.kernel.zmq.session import Session, Message
52 from IPython.zmq import serialize
52 from IPython.kernel.zmq import serialize
53
53
54 from .asyncresult import AsyncResult, AsyncHubResult
54 from .asyncresult import AsyncResult, AsyncHubResult
55 from .view import DirectView, LoadBalancedView
55 from .view import DirectView, LoadBalancedView
@@ -39,7 +39,7 b' from IPython.utils.traitlets import ('
39 from IPython.parallel import error, util
39 from IPython.parallel import error, util
40 from IPython.parallel.factory import RegistrationFactory
40 from IPython.parallel.factory import RegistrationFactory
41
41
42 from IPython.zmq.session import SessionFactory
42 from IPython.kernel.zmq.session import SessionFactory
43
43
44 from .heartmonitor import HeartMonitor
44 from .heartmonitor import HeartMonitor
45
45
@@ -34,20 +34,20 b' from IPython.parallel.controller.heartmonitor import Heart'
34 from IPython.parallel.factory import RegistrationFactory
34 from IPython.parallel.factory import RegistrationFactory
35 from IPython.parallel.util import disambiguate_url
35 from IPython.parallel.util import disambiguate_url
36
36
37 from IPython.zmq.session import Message
37 from IPython.kernel.zmq.session import Message
38 from IPython.zmq.ipkernel import Kernel
38 from IPython.kernel.zmq.ipkernel import Kernel
39 from IPython.zmq.kernelapp import IPKernelApp
39 from IPython.kernel.zmq.kernelapp import IPKernelApp
40
40
41 class EngineFactory(RegistrationFactory):
41 class EngineFactory(RegistrationFactory):
42 """IPython engine"""
42 """IPython engine"""
43
43
44 # configurables:
44 # configurables:
45 out_stream_factory=Type('IPython.zmq.iostream.OutStream', config=True,
45 out_stream_factory=Type('IPython.kernel.zmq.iostream.OutStream', config=True,
46 help="""The OutStream for handling stdout/err.
46 help="""The OutStream for handling stdout/err.
47 Typically 'IPython.zmq.iostream.OutStream'""")
47 Typically 'IPython.kernel.zmq.iostream.OutStream'""")
48 display_hook_factory=Type('IPython.zmq.displayhook.ZMQDisplayHook', config=True,
48 display_hook_factory=Type('IPython.kernel.zmq.displayhook.ZMQDisplayHook', config=True,
49 help="""The class for handling displayhook.
49 help="""The class for handling displayhook.
50 Typically 'IPython.zmq.displayhook.ZMQDisplayHook'""")
50 Typically 'IPython.kernel.zmq.displayhook.ZMQDisplayHook'""")
51 location=Unicode(config=True,
51 location=Unicode(config=True,
52 help="""The location (an IP address) of the controller. This is
52 help="""The location (an IP address) of the controller. This is
53 used for disambiguating URLs, to determine whether
53 used for disambiguating URLs, to determine whether
@@ -28,7 +28,7 b' from IPython.utils.localinterfaces import LOCALHOST'
28 from IPython.utils.traitlets import Integer, Instance, Unicode
28 from IPython.utils.traitlets import Integer, Instance, Unicode
29
29
30 from IPython.parallel.util import select_random_ports
30 from IPython.parallel.util import select_random_ports
31 from IPython.zmq.session import Session, SessionFactory
31 from IPython.kernel.zmq.session import Session, SessionFactory
32
32
33 #-----------------------------------------------------------------------------
33 #-----------------------------------------------------------------------------
34 # Classes
34 # Classes
@@ -273,7 +273,7 b' class AsyncResultTest(ClusterTestCase):'
273 v = self.client[-1]
273 v = self.client[-1]
274 ar = v.execute('\n'.join([
274 ar = v.execute('\n'.join([
275 "import time",
275 "import time",
276 "from IPython.zmq.datapub import publish_data",
276 "from IPython.kernel.zmq.datapub import publish_data",
277 "for i in range(5):",
277 "for i in range(5):",
278 " publish_data(dict(i=i))",
278 " publish_data(dict(i=i))",
279 " time.sleep(0.1)",
279 " time.sleep(0.1)",
@@ -32,7 +32,7 b' from IPython.parallel.controller.sqlitedb import SQLiteDB'
32 from IPython.parallel.controller.hub import init_record, empty_record
32 from IPython.parallel.controller.hub import init_record, empty_record
33
33
34 from IPython.testing import decorators as dec
34 from IPython.testing import decorators as dec
35 from IPython.zmq.session import Session
35 from IPython.kernel.zmq.session import Session
36
36
37
37
38 #-------------------------------------------------------------------------------
38 #-------------------------------------------------------------------------------
@@ -650,7 +650,7 b' class TestView(ClusterTestCase, ParametricTestCase):'
650 def test_data_pub_single(self):
650 def test_data_pub_single(self):
651 view = self.client[-1]
651 view = self.client[-1]
652 ar = view.execute('\n'.join([
652 ar = view.execute('\n'.join([
653 'from IPython.zmq.datapub import publish_data',
653 'from IPython.kernel.zmq.datapub import publish_data',
654 'for i in range(5):',
654 'for i in range(5):',
655 ' publish_data(dict(i=i))'
655 ' publish_data(dict(i=i))'
656 ]), block=False)
656 ]), block=False)
@@ -661,7 +661,7 b' class TestView(ClusterTestCase, ParametricTestCase):'
661 def test_data_pub(self):
661 def test_data_pub(self):
662 view = self.client[:]
662 view = self.client[:]
663 ar = view.execute('\n'.join([
663 ar = view.execute('\n'.join([
664 'from IPython.zmq.datapub import publish_data',
664 'from IPython.kernel.zmq.datapub import publish_data',
665 'for i in range(5):',
665 'for i in range(5):',
666 ' publish_data(dict(i=i))'
666 ' publish_data(dict(i=i))'
667 ]), block=False)
667 ]), block=False)
@@ -44,8 +44,8 b' from IPython.external.decorator import decorator'
44 # IPython imports
44 # IPython imports
45 from IPython.config.application import Application
45 from IPython.config.application import Application
46 from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS
46 from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS
47 from IPython.zmq.log import EnginePUBHandler
47 from IPython.kernel.zmq.log import EnginePUBHandler
48 from IPython.zmq.serialize import (
48 from IPython.kernel.zmq.serialize import (
49 unserialize_object, serialize_object, pack_apply_message, unpack_apply_message
49 unserialize_object, serialize_object, pack_apply_message, unpack_apply_message
50 )
50 )
51
51
General Comments 0
You need to be logged in to leave comments. Login now