Show More
@@ -66,6 +66,7 b' var IPython = (function (IPython) {' | |||||
66 | this.input_prompt_number = null; |
|
66 | this.input_prompt_number = null; | |
67 | this.collapsed = false; |
|
67 | this.collapsed = false; | |
68 | this.cell_type = "code"; |
|
68 | this.cell_type = "code"; | |
|
69 | this.last_msg_id = null; | |||
69 |
|
70 | |||
70 |
|
71 | |||
71 | var cm_overwrite_options = { |
|
72 | var cm_overwrite_options = { | |
@@ -243,6 +244,9 b' var IPython = (function (IPython) {' | |||||
243 | this.output_area.clear_output(true, true, true); |
|
244 | this.output_area.clear_output(true, true, true); | |
244 | this.set_input_prompt('*'); |
|
245 | this.set_input_prompt('*'); | |
245 | this.element.addClass("running"); |
|
246 | this.element.addClass("running"); | |
|
247 | if (this.last_msg_id) { | |||
|
248 | this.kernel.clear_callbacks_for_msg(this.last_msg_id); | |||
|
249 | } | |||
246 | var callbacks = { |
|
250 | var callbacks = { | |
247 | 'execute_reply': $.proxy(this._handle_execute_reply, this), |
|
251 | 'execute_reply': $.proxy(this._handle_execute_reply, this), | |
248 | 'output': $.proxy(this.output_area.handle_output, this.output_area), |
|
252 | 'output': $.proxy(this.output_area.handle_output, this.output_area), | |
@@ -250,7 +254,7 b' var IPython = (function (IPython) {' | |||||
250 | 'set_next_input': $.proxy(this._handle_set_next_input, this), |
|
254 | 'set_next_input': $.proxy(this._handle_set_next_input, this), | |
251 | 'input_request': $.proxy(this._handle_input_request, this) |
|
255 | 'input_request': $.proxy(this._handle_input_request, this) | |
252 | }; |
|
256 | }; | |
253 |
|
|
257 | this.last_msg_id = this.kernel.execute(this.get_text(), callbacks, {silent: false, store_history: true}); | |
254 | }; |
|
258 | }; | |
255 |
|
259 | |||
256 | /** |
|
260 | /** |
@@ -403,9 +403,16 b' var IPython = (function (IPython) {' | |||||
403 | }; |
|
403 | }; | |
404 |
|
404 | |||
405 |
|
405 | |||
|
406 | Kernel.prototype.clear_callbacks_for_msg = function (msg_id) { | |||
|
407 | if (this._msg_callbacks[msg_id] !== undefined ) { | |||
|
408 | delete this._msg_callbacks[msg_id]; | |||
|
409 | } | |||
|
410 | }; | |||
|
411 | ||||
|
412 | ||||
406 | Kernel.prototype.set_callbacks_for_msg = function (msg_id, callbacks) { |
|
413 | Kernel.prototype.set_callbacks_for_msg = function (msg_id, callbacks) { | |
407 | this._msg_callbacks[msg_id] = callbacks || {}; |
|
414 | this._msg_callbacks[msg_id] = callbacks || {}; | |
408 | } |
|
415 | }; | |
409 |
|
416 | |||
410 |
|
417 | |||
411 | Kernel.prototype._handle_shell_reply = function (e) { |
|
418 | Kernel.prototype._handle_shell_reply = function (e) { |
General Comments 0
You need to be logged in to leave comments.
Login now