pyout -> execute_result

nbformat and nbconvert are not affected
MinRK 13 years ago
parent 6b7d3fddec
commit 38c76aa913

@ -1,9 +1,5 @@
//----------------------------------------------------------------------------
// Copyright (C) 2008 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.
//============================================================================
// OutputArea
@ -221,9 +217,12 @@ var IPython = (function (IPython) {
json = content.data;
json.output_type = msg_type;
json.metadata = content.metadata;
} else if (msg_type === "pyout") {
} else if (msg_type === "execute_result") {
json = content.data;
json.output_type = msg_type;
// pyout message has been renamed to execute_result,
// but the nbformat has not been updated,
// so transform back to pyout for json.
json.output_type = "pyout";
json.metadata = content.metadata;
json.prompt_number = content.execution_count;
} else if (msg_type === "pyerr") {
@ -284,7 +283,7 @@ var IPython = (function (IPython) {
}
if (json.output_type === 'pyout') {
this.append_pyout(json);
this.append_execute_result(json);
} else if (json.output_type === 'pyerr') {
this.append_pyerr(json);
} else if (json.output_type === 'stream') {
@ -406,7 +405,7 @@ var IPython = (function (IPython) {
};
OutputArea.prototype.append_pyout = function (json) {
OutputArea.prototype.append_execute_result = function (json) {
var n = json.prompt_number || ' ';
var toinsert = this.create_output_area();
if (this.prompt_area) {

@ -76,7 +76,7 @@ var IPython = (function (IPython) {
// Initialize the iopub handlers
Kernel.prototype.init_iopub_handlers = function () {
var output_types = ['stream', 'display_data', 'pyout', 'pyerr'];
var output_types = ['stream', 'display_data', 'execute_result', 'pyerr'];
this._iopub_handlers = {};
this.register_iopub_handler('status', $.proxy(this._handle_status_message, this));
this.register_iopub_handler('clear_output', $.proxy(this._handle_clear_output, this));
@ -573,7 +573,7 @@ var IPython = (function (IPython) {
};
// handle an output message (pyout, display_data, etc.)
// handle an output message (execute_result, display_data, etc.)
Kernel.prototype._handle_output_message = function (msg) {
var callbacks = this.get_callbacks_for_msg(msg.parent_header.msg_id);
if (!callbacks || !callbacks.iopub) {

@ -33,7 +33,7 @@ function assert_has(short_name, json, result, result2) {
}
// helper function for checkout that the first two cells have a particular
// output_type (either 'pyout' or 'display_data'), and checks the to/fromJSON
// output_type (either 'execute_result' or 'display_data'), and checks the to/fromJSON
// for a set of mimetype keys, using their short names ('javascript', 'text',
// 'png', etc).
function check_output_area(output_type, keys) {
@ -109,7 +109,7 @@ casper.notebook_test(function () {
});
this.then(function () {
check_output_area.apply(this, ['pyout', ['text', 'json']]);
check_output_area.apply(this, ['execute_result', ['text', 'json']]);
});
this.then(function() {
@ -127,7 +127,7 @@ casper.notebook_test(function () {
});
this.then(function ( ) {
check_output_area.apply(this, ['pyout', ['text', 'latex']]);
check_output_area.apply(this, ['execute_result', ['text', 'latex']]);
});
this.then(function() {
@ -145,7 +145,7 @@ casper.notebook_test(function () {
});
this.then(function ( ) {
check_output_area.apply(this, ['pyout', ['text', 'html']]);
check_output_area.apply(this, ['execute_result', ['text', 'html']]);
});
this.then(function() {
@ -165,7 +165,7 @@ casper.notebook_test(function () {
this.thenEvaluate(function() { IPython.notebook.save_notebook(); });
this.then(function ( ) {
check_output_area.apply(this, ['pyout', ['text', 'png']]);
check_output_area.apply(this, ['execute_result', ['text', 'png']]);
});
this.then(function() {
@ -184,7 +184,7 @@ casper.notebook_test(function () {
});
this.then(function ( ) {
check_output_area.apply(this, ['pyout', ['text', 'jpeg']]);
check_output_area.apply(this, ['execute_result', ['text', 'jpeg']]);
});
this.then(function() {
@ -202,7 +202,7 @@ casper.notebook_test(function () {
});
this.then(function ( ) {
check_output_area.apply(this, ['pyout', ['text', 'svg']]);
check_output_area.apply(this, ['execute_result', ['text', 'svg']]);
});
this.then(function() {
@ -238,7 +238,7 @@ casper.notebook_test(function () {
'display_data custom mimetype ' + long_name);
var result = this.get_output_cell(0, 1);
this.test.assertTrue(result.hasOwnProperty(long_name),
'pyout custom mimetype ' + long_name);
'execute_result custom mimetype ' + long_name);
});

Loading…
Cancel
Save