##// END OF EJS Templates
fix to minrk suggestion
Matthias BUSSONNIER -
Show More
@@ -374,10 +374,8 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):'
374 374 """ Handles replies for code execution.
375 375 """
376 376 self.log.debug("execute: %s", msg.get('content', ''))
377 info_list = self._request_info.get('execute')
378 377 msg_id = msg['parent_header']['msg_id']
379 if msg_id in info_list:
380 info = info_list[msg_id]
378 info = self._request_info['execute'].get(msg_id)
381 379 # unset reading flag, because if execute finished, raw_input can't
382 380 # still be pending.
383 381 self._reading = False
@@ -403,7 +401,7 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):'
403 401
404 402 self._show_interpreter_prompt_for_reply(msg)
405 403 self.executed.emit(msg)
406 info_list.pop(msg_id)
404 self._request_info['execute'].pop(msg_id)
407 405 elif info and info.kind == 'silent_exec_callback' and not self._hidden:
408 406 self._handle_exec_callback(msg)
409 407 else:
@@ -216,15 +216,13 b' class HistoryConsoleWidget(ConsoleWidget):'
216 216 def _handle_execute_reply(self, msg):
217 217 """ Handles replies for code execution, here only session history length
218 218 """
219 info_list = self._request_info.get('execute')
220 219 msg_id = msg['parent_header']['msg_id']
221 if msg_id in info_list:
222 info = info_list.pop(msg_id)
223 if info.kind == 'save_magic' and not self._hidden:
224 content = msg['content']
225 status = content['status']
226 if status == 'ok':
227 self._max_session_history=(int(content['user_expressions']['hlen']))
220 info = self._request_info.get['execute'].pop(msg_id,None)
221 if info and info.kind == 'save_magic' and not self._hidden:
222 content = msg['content']
223 status = content['status']
224 if status == 'ok':
225 self._max_session_history=(int(content['user_expressions']['hlen']))
228 226
229 227 def save_magic(self):
230 228 # update the session history length
@@ -165,16 +165,14 b' class IPythonWidget(FrontendWidget):'
165 165 def _handle_execute_reply(self, msg):
166 166 """ Reimplemented to support prompt requests.
167 167 """
168 info_list = self._request_info.get('execute')
169 msg_id = msg['parent_header']['msg_id']
170 if msg_id in info_list:
171 info = info_list[msg_id]
172 if info.kind == 'prompt':
173 number = msg['content']['execution_count'] + 1
174 self._show_interpreter_prompt(number)
175 info_list.pop(msg_id)
176 else:
177 super(IPythonWidget, self)._handle_execute_reply(msg)
168 msg_id = msg['parent_header'].get('msg_id')
169 info = self._request_info['execute'].get(msg_id)
170 if info and info.kind == 'prompt':
171 number = msg['content']['execution_count'] + 1
172 self._show_interpreter_prompt(number)
173 self._request_info['execute'].pop(msg_id)
174 else:
175 super(IPythonWidget, self)._handle_execute_reply(msg)
178 176
179 177 def _handle_history_reply(self, msg):
180 178 """ Implemented to handle history tail replies, which are only supported
General Comments 0
You need to be logged in to leave comments. Login now