From 2a1cc002e2d0ba32519fa77db246250e4ee5da92 2010-08-26 07:50:15 From: Fernando Perez Date: 2010-08-26 07:50:15 Subject: [PATCH] Update production code to public names of raw_print functions. --- diff --git a/IPython/zmq/entry_point.py b/IPython/zmq/entry_point.py index a48904d..e8ffc4b 100644 --- a/IPython/zmq/entry_point.py +++ b/IPython/zmq/entry_point.py @@ -70,21 +70,21 @@ def make_kernel(namespace, kernel_factory, ) # Create a context, a session, and the kernel sockets. - io.rprint("Starting the kernel...") + io.raw_print("Starting the kernel...") context = zmq.Context() session = Session(username=u'kernel') reply_socket = context.socket(zmq.XREP) xrep_port = bind_port(reply_socket, namespace.ip, namespace.xrep) - io.rprint("XREP Channel on port", xrep_port) + io.raw_print("XREP Channel on port", xrep_port) pub_socket = context.socket(zmq.PUB) pub_port = bind_port(pub_socket, namespace.ip, namespace.pub) - io.rprint("PUB Channel on port", pub_port) + io.raw_print("PUB Channel on port", pub_port) req_socket = context.socket(zmq.XREQ) req_port = bind_port(req_socket, namespace.ip, namespace.req) - io.rprint("REQ Channel on port", req_port) + io.raw_print("REQ Channel on port", req_port) # Redirect input streams and set a display hook. if out_stream_factory: diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index 92fdd1c..5cf3d37 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -82,11 +82,11 @@ class Kernel(Configurable): # assert self.reply_socket.rcvmore(), "Missing message part." msg = self.reply_socket.recv_json() omsg = Message(msg) - io.rprint('\n') - io.rprint(omsg) + io.raw_print('\n') + io.raw_print(omsg) handler = self.handlers.get(omsg.msg_type, None) if handler is None: - io.rprinte("UNKNOWN MESSAGE TYPE:", omsg) + io.raw_print_err("UNKNOWN MESSAGE TYPE:", omsg) else: handler(ident, omsg) @@ -106,8 +106,8 @@ class Kernel(Configurable): try: code = parent[u'content'][u'code'] except: - io.rprinte("Got bad msg: ") - io.rprinte(Message(parent)) + io.raw_print_err("Got bad msg: ") + io.raw_print_err(Message(parent)) return pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent) self.pub_socket.send_json(pyin_msg) @@ -164,7 +164,7 @@ class Kernel(Configurable): # Send the reply. reply_msg = self.session.msg(u'execute_reply', reply_content, parent) - io.rprint(Message(reply_msg)) + io.raw_print(Message(reply_msg)) self.reply_socket.send(ident, zmq.SNDMORE) self.reply_socket.send_json(reply_msg) if reply_msg['content']['status'] == u'error': @@ -177,14 +177,14 @@ class Kernel(Configurable): 'status' : 'ok'} completion_msg = self.session.send(self.reply_socket, 'complete_reply', matches, parent, ident) - io.rprint(completion_msg) + io.raw_print(completion_msg) def object_info_request(self, ident, parent): context = parent['content']['oname'].split('.') object_info = self._object_info(context) msg = self.session.send(self.reply_socket, 'object_info_reply', object_info, parent, ident) - io.rprint(msg) + io.raw_print(msg) def prompt_request(self, ident, parent): prompt_number = self.shell.displayhook.prompt_count @@ -194,7 +194,7 @@ class Kernel(Configurable): 'input_sep' : self.shell.displayhook.input_sep} msg = self.session.send(self.reply_socket, 'prompt_reply', content, parent, ident) - io.rprint(msg) + io.raw_print(msg) def history_request(self, ident, parent): output = parent['content']['output'] @@ -204,7 +204,7 @@ class Kernel(Configurable): content = {'history' : hist} msg = self.session.send(self.reply_socket, 'history_reply', content, parent, ident) - io.rprint(msg) + io.raw_print(msg) #--------------------------------------------------------------------------- # Protected interface @@ -220,11 +220,11 @@ class Kernel(Configurable): else: assert self.reply_socket.rcvmore(), "Unexpected missing message part." msg = self.reply_socket.recv_json() - io.rprint("Aborting:\n", Message(msg)) + io.raw_print("Aborting:\n", Message(msg)) msg_type = msg['msg_type'] reply_type = msg_type.split('_')[0] + '_reply' reply_msg = self.session.msg(reply_type, {'status' : 'aborted'}, msg) - io.rprint(Message(reply_msg)) + io.raw_print(Message(reply_msg)) self.reply_socket.send(ident,zmq.SNDMORE) self.reply_socket.send_json(reply_msg) # We need to wait a bit for requests to come in. This can probably @@ -246,8 +246,8 @@ class Kernel(Configurable): try: value = reply['content']['value'] except: - io.rprinte("Got bad raw_input reply: ") - io.rprinte(Message(parent)) + io.raw_print_err("Got bad raw_input reply: ") + io.raw_print_err(Message(parent)) value = '' return value diff --git a/IPython/zmq/zmqshell.py b/IPython/zmq/zmqshell.py index b87767e..af4a7b9 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/zmq/zmqshell.py @@ -8,7 +8,6 @@ from IPython.core.interactiveshell import ( ) from IPython.core.displayhook import DisplayHook from IPython.core.macro import Macro -from IPython.utils.io import rprint from IPython.utils.path import get_py_filename from IPython.utils.text import StringTypes from IPython.utils.traitlets import Instance, Type, Dict