From feb0a3d2bf55b976462038170e13e6cc4cac0d15 2014-05-07 05:39:01 From: MinRK Date: 2014-05-07 05:39:01 Subject: [PATCH] pyin -> execute_input --- diff --git a/IPython/kernel/tests/test_message_spec.py b/IPython/kernel/tests/test_message_spec.py index 02c4003..8784076 100644 --- a/IPython/kernel/tests/test_message_spec.py +++ b/IPython/kernel/tests/test_message_spec.py @@ -160,7 +160,7 @@ class KernelInfoReply(Reference): # IOPub messages -class PyIn(Reference): +class ExecuteInput(Reference): code = Unicode() execution_count = Integer() @@ -200,7 +200,7 @@ references = { 'status' : Status(), 'complete_reply' : CompleteReply(), 'kernel_info_reply': KernelInfoReply(), - 'pyin' : PyIn(), + 'execute_input' : ExecuteInput(), 'pyout' : PyOut(), 'pyerr' : PyErr(), 'stream' : Stream(), diff --git a/IPython/kernel/tests/utils.py b/IPython/kernel/tests/utils.py index 1f257ad..3ba288d 100644 --- a/IPython/kernel/tests/utils.py +++ b/IPython/kernel/tests/utils.py @@ -1,15 +1,7 @@ """utilities for testing IPython kernels""" -#------------------------------------------------------------------------------- -# Copyright (C) 2013 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Imports -#------------------------------------------------------------------------------- +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. import atexit @@ -84,9 +76,9 @@ def execute(code='', kc=None, **kwargs): nt.assert_equal(busy['content']['execution_state'], 'busy') if not kwargs.get('silent'): - pyin = kc.get_iopub_msg(timeout=TIMEOUT) - validate_message(pyin, 'pyin', msg_id) - nt.assert_equal(pyin['content']['code'], code) + execute_input = kc.get_iopub_msg(timeout=TIMEOUT) + validate_message(execute_input, 'execute_input', msg_id) + nt.assert_equal(execute_input['content']['code'], code) return msg_id, reply['content'] diff --git a/IPython/kernel/zmq/ipkernel.py b/IPython/kernel/zmq/ipkernel.py index e6e479b..9cf7a18 100755 --- a/IPython/kernel/zmq/ipkernel.py +++ b/IPython/kernel/zmq/ipkernel.py @@ -317,12 +317,12 @@ class Kernel(Configurable): new_md.update(other) return new_md - def _publish_pyin(self, code, parent, execution_count): - """Publish the code request on the pyin stream.""" + def _publish_execute_input(self, code, parent, execution_count): + """Publish the code request on the iopub stream.""" - self.session.send(self.iopub_socket, u'pyin', + self.session.send(self.iopub_socket, u'execute_input', {u'code':code, u'execution_count': execution_count}, - parent=parent, ident=self._topic('pyin') + parent=parent, ident=self._topic('execute_input') ) def _publish_status(self, status, parent=None): @@ -377,7 +377,7 @@ class Kernel(Configurable): # Re-broadcast our input for the benefit of listening clients, and # start computing output if not silent: - self._publish_pyin(code, parent, shell.execution_count) + self._publish_execute_input(code, parent, shell.execution_count) reply_content = {} # FIXME: the shell calls the exception handler itself. @@ -581,9 +581,9 @@ class Kernel(Configurable): shell = self.shell shell.set_parent(parent) - # pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent) - # self.iopub_socket.send(pyin_msg) - # self.session.send(self.iopub_socket, u'pyin', {u'code':code},parent=parent) + # execute_input_msg = self.session.msg(u'execute_input',{u'code':code}, parent=parent) + # self.iopub_socket.send(execute_input_msg) + # self.session.send(self.iopub_socket, u'execute_input', {u'code':code},parent=parent) md = self._make_metadata(parent['metadata']) try: working = shell.user_ns diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index 25ad7c7..f0462ae 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -1,20 +1,9 @@ -"""A semi-synchronous Client for the ZMQ cluster +"""A semi-synchronous Client for IPython parallel""" -Authors: +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. -* MinRK -""" from __future__ import print_function -#----------------------------------------------------------------------------- -# Copyright (C) 2010-2011 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- import os import json @@ -29,7 +18,6 @@ from pprint import pprint pjoin = os.path.join import zmq -# from zmq.eventloop import ioloop, zmqstream from IPython.config.configurable import MultipleInstanceError from IPython.core.application import BaseIPythonApplication @@ -181,7 +169,7 @@ class Metadata(dict): 'after' : None, 'status' : None, - 'pyin' : None, + 'execute_input' : None, 'pyout' : None, 'pyerr' : None, 'stdout' : '', @@ -883,8 +871,8 @@ class Client(HasTraits): md[name] = s + content['data'] elif msg_type == 'pyerr': md.update({'pyerr' : self._unwrap_exception(content)}) - elif msg_type == 'pyin': - md.update({'pyin' : content['code']}) + elif msg_type == 'execute_input': + md.update({'execute_input' : content['code']}) elif msg_type == 'display_data': md['outputs'].append(content) elif msg_type == 'pyout': diff --git a/IPython/parallel/controller/hub.py b/IPython/parallel/controller/hub.py index ee89133..3dfc0a6 100644 --- a/IPython/parallel/controller/hub.py +++ b/IPython/parallel/controller/hub.py @@ -1,21 +1,12 @@ """The IPython Controller Hub with 0MQ + This is the master object that handles connections from engines and clients, and monitors traffic through the various queues. - -Authors: - -* Min RK """ -#----------------------------------------------------------------------------- -# Copyright (C) 2010-2011 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + from __future__ import print_function import json @@ -75,7 +66,7 @@ def empty_record(): 'result_content' : None, 'result_buffers' : None, 'queue' : None, - 'pyin' : None, + 'execute_input' : None, 'pyout': None, 'pyerr': None, 'stdout': '', @@ -103,7 +94,7 @@ def init_record(msg): 'result_content' : None, 'result_buffers' : None, 'queue' : None, - 'pyin' : None, + 'execute_input' : None, 'pyout': None, 'pyerr': None, 'stdout': '', @@ -876,8 +867,8 @@ class Hub(SessionFactory): elif msg_type == 'pyerr': d['pyerr'] = content - elif msg_type == 'pyin': - d['pyin'] = content['code'] + elif msg_type == 'execute_input': + d['execute_input'] = content['code'] elif msg_type in ('display_data', 'pyout'): d[msg_type] = content elif msg_type == 'status': @@ -1325,7 +1316,7 @@ class Hub(SessionFactory): def _extract_record(self, rec): """decompose a TaskRecord dict into subsection of reply for get_result""" io_dict = {} - for key in ('pyin', 'pyout', 'pyerr', 'stdout', 'stderr'): + for key in ('execute_input', 'pyout', 'pyerr', 'stdout', 'stderr'): io_dict[key] = rec[key] content = { 'header': rec['header'], diff --git a/IPython/parallel/controller/sqlitedb.py b/IPython/parallel/controller/sqlitedb.py index 2187af1..39cbeb0 100644 --- a/IPython/parallel/controller/sqlitedb.py +++ b/IPython/parallel/controller/sqlitedb.py @@ -1,15 +1,7 @@ -"""A TaskRecord backend using sqlite3 +"""A TaskRecord backend using sqlite3""" -Authors: - -* Min RK -""" -#----------------------------------------------------------------------------- -# Copyright (C) 2011 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. import json import os @@ -128,7 +120,7 @@ class SQLiteDB(BaseDB): 'result_content' , 'result_buffers' , 'queue' , - 'pyin' , + 'execute_input' , 'pyout', 'pyerr', 'stdout', @@ -152,7 +144,7 @@ class SQLiteDB(BaseDB): 'result_content' : 'dict text', 'result_buffers' : 'bufs blob', 'queue' : 'text', - 'pyin' : 'text', + 'execute_input' : 'text', 'pyout' : 'text', 'pyerr' : 'text', 'stdout' : 'text', @@ -263,7 +255,7 @@ class SQLiteDB(BaseDB): result_content dict text, result_buffers bufs blob, queue text, - pyin text, + execute_input text, pyout text, pyerr text, stdout text, diff --git a/IPython/qt/kernel_mixins.py b/IPython/qt/kernel_mixins.py index 0f3a09d..23d720f 100644 --- a/IPython/qt/kernel_mixins.py +++ b/IPython/qt/kernel_mixins.py @@ -1,10 +1,10 @@ -""" Defines a KernelManager that provides signals and slots. -""" +"""Defines a KernelManager that provides signals and slots.""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. -# System library imports. from IPython.external.qt import QtCore -# IPython imports. from IPython.utils.traitlets import HasTraits, Type from .util import MetaQObjectHasTraits, SuperQObject @@ -85,8 +85,8 @@ class QtIOPubChannelMixin(ChannelQObject): # Emitted when a message of type 'stream' is received. stream_received = QtCore.Signal(object) - # Emitted when a message of type 'pyin' is received. - pyin_received = QtCore.Signal(object) + # Emitted when a message of type 'execute_input' is received. + execute_input_received = QtCore.Signal(object) # Emitted when a message of type 'pyout' is received. pyout_received = QtCore.Signal(object)