Show More
@@ -70,21 +70,21 b' def make_kernel(namespace, kernel_factory,' | |||
|
70 | 70 | ) |
|
71 | 71 | |
|
72 | 72 | # Create a context, a session, and the kernel sockets. |
|
73 | io.rprint("Starting the kernel...") | |
|
73 | io.raw_print("Starting the kernel...") | |
|
74 | 74 | context = zmq.Context() |
|
75 | 75 | session = Session(username=u'kernel') |
|
76 | 76 | |
|
77 | 77 | reply_socket = context.socket(zmq.XREP) |
|
78 | 78 | xrep_port = bind_port(reply_socket, namespace.ip, namespace.xrep) |
|
79 | io.rprint("XREP Channel on port", xrep_port) | |
|
79 | io.raw_print("XREP Channel on port", xrep_port) | |
|
80 | 80 | |
|
81 | 81 | pub_socket = context.socket(zmq.PUB) |
|
82 | 82 | pub_port = bind_port(pub_socket, namespace.ip, namespace.pub) |
|
83 | io.rprint("PUB Channel on port", pub_port) | |
|
83 | io.raw_print("PUB Channel on port", pub_port) | |
|
84 | 84 | |
|
85 | 85 | req_socket = context.socket(zmq.XREQ) |
|
86 | 86 | req_port = bind_port(req_socket, namespace.ip, namespace.req) |
|
87 | io.rprint("REQ Channel on port", req_port) | |
|
87 | io.raw_print("REQ Channel on port", req_port) | |
|
88 | 88 | |
|
89 | 89 | # Redirect input streams and set a display hook. |
|
90 | 90 | if out_stream_factory: |
@@ -82,11 +82,11 b' class Kernel(Configurable):' | |||
|
82 | 82 | # assert self.reply_socket.rcvmore(), "Missing message part." |
|
83 | 83 | msg = self.reply_socket.recv_json() |
|
84 | 84 | omsg = Message(msg) |
|
85 | io.rprint('\n') | |
|
86 | io.rprint(omsg) | |
|
85 | io.raw_print('\n') | |
|
86 | io.raw_print(omsg) | |
|
87 | 87 | handler = self.handlers.get(omsg.msg_type, None) |
|
88 | 88 | if handler is None: |
|
89 | io.rprinte("UNKNOWN MESSAGE TYPE:", omsg) | |
|
89 | io.raw_print_err("UNKNOWN MESSAGE TYPE:", omsg) | |
|
90 | 90 | else: |
|
91 | 91 | handler(ident, omsg) |
|
92 | 92 | |
@@ -106,8 +106,8 b' class Kernel(Configurable):' | |||
|
106 | 106 | try: |
|
107 | 107 | code = parent[u'content'][u'code'] |
|
108 | 108 | except: |
|
109 | io.rprinte("Got bad msg: ") | |
|
110 | io.rprinte(Message(parent)) | |
|
109 | io.raw_print_err("Got bad msg: ") | |
|
110 | io.raw_print_err(Message(parent)) | |
|
111 | 111 | return |
|
112 | 112 | pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent) |
|
113 | 113 | self.pub_socket.send_json(pyin_msg) |
@@ -164,7 +164,7 b' class Kernel(Configurable):' | |||
|
164 | 164 | |
|
165 | 165 | # Send the reply. |
|
166 | 166 | reply_msg = self.session.msg(u'execute_reply', reply_content, parent) |
|
167 | io.rprint(Message(reply_msg)) | |
|
167 | io.raw_print(Message(reply_msg)) | |
|
168 | 168 | self.reply_socket.send(ident, zmq.SNDMORE) |
|
169 | 169 | self.reply_socket.send_json(reply_msg) |
|
170 | 170 | if reply_msg['content']['status'] == u'error': |
@@ -177,14 +177,14 b' class Kernel(Configurable):' | |||
|
177 | 177 | 'status' : 'ok'} |
|
178 | 178 | completion_msg = self.session.send(self.reply_socket, 'complete_reply', |
|
179 | 179 | matches, parent, ident) |
|
180 | io.rprint(completion_msg) | |
|
180 | io.raw_print(completion_msg) | |
|
181 | 181 | |
|
182 | 182 | def object_info_request(self, ident, parent): |
|
183 | 183 | context = parent['content']['oname'].split('.') |
|
184 | 184 | object_info = self._object_info(context) |
|
185 | 185 | msg = self.session.send(self.reply_socket, 'object_info_reply', |
|
186 | 186 | object_info, parent, ident) |
|
187 | io.rprint(msg) | |
|
187 | io.raw_print(msg) | |
|
188 | 188 | |
|
189 | 189 | def prompt_request(self, ident, parent): |
|
190 | 190 | prompt_number = self.shell.displayhook.prompt_count |
@@ -194,7 +194,7 b' class Kernel(Configurable):' | |||
|
194 | 194 | 'input_sep' : self.shell.displayhook.input_sep} |
|
195 | 195 | msg = self.session.send(self.reply_socket, 'prompt_reply', |
|
196 | 196 | content, parent, ident) |
|
197 | io.rprint(msg) | |
|
197 | io.raw_print(msg) | |
|
198 | 198 | |
|
199 | 199 | def history_request(self, ident, parent): |
|
200 | 200 | output = parent['content']['output'] |
@@ -204,7 +204,7 b' class Kernel(Configurable):' | |||
|
204 | 204 | content = {'history' : hist} |
|
205 | 205 | msg = self.session.send(self.reply_socket, 'history_reply', |
|
206 | 206 | content, parent, ident) |
|
207 | io.rprint(msg) | |
|
207 | io.raw_print(msg) | |
|
208 | 208 | |
|
209 | 209 | #--------------------------------------------------------------------------- |
|
210 | 210 | # Protected interface |
@@ -220,11 +220,11 b' class Kernel(Configurable):' | |||
|
220 | 220 | else: |
|
221 | 221 | assert self.reply_socket.rcvmore(), "Unexpected missing message part." |
|
222 | 222 | msg = self.reply_socket.recv_json() |
|
223 | io.rprint("Aborting:\n", Message(msg)) | |
|
223 | io.raw_print("Aborting:\n", Message(msg)) | |
|
224 | 224 | msg_type = msg['msg_type'] |
|
225 | 225 | reply_type = msg_type.split('_')[0] + '_reply' |
|
226 | 226 | reply_msg = self.session.msg(reply_type, {'status' : 'aborted'}, msg) |
|
227 | io.rprint(Message(reply_msg)) | |
|
227 | io.raw_print(Message(reply_msg)) | |
|
228 | 228 | self.reply_socket.send(ident,zmq.SNDMORE) |
|
229 | 229 | self.reply_socket.send_json(reply_msg) |
|
230 | 230 | # We need to wait a bit for requests to come in. This can probably |
@@ -246,8 +246,8 b' class Kernel(Configurable):' | |||
|
246 | 246 | try: |
|
247 | 247 | value = reply['content']['value'] |
|
248 | 248 | except: |
|
249 | io.rprinte("Got bad raw_input reply: ") | |
|
250 | io.rprinte(Message(parent)) | |
|
249 | io.raw_print_err("Got bad raw_input reply: ") | |
|
250 | io.raw_print_err(Message(parent)) | |
|
251 | 251 | value = '' |
|
252 | 252 | return value |
|
253 | 253 |
@@ -8,7 +8,6 b' from IPython.core.interactiveshell import (' | |||
|
8 | 8 | ) |
|
9 | 9 | from IPython.core.displayhook import DisplayHook |
|
10 | 10 | from IPython.core.macro import Macro |
|
11 | from IPython.utils.io import rprint | |
|
12 | 11 | from IPython.utils.path import get_py_filename |
|
13 | 12 | from IPython.utils.text import StringTypes |
|
14 | 13 | from IPython.utils.traitlets import Instance, Type, Dict |
General Comments 0
You need to be logged in to leave comments.
Login now