pyerr -> error

This commit is contained in:
MinRK 2013-11-13 15:39:27 -08:00
parent 38c76aa913
commit 5fb9837f5a
2 changed files with 12 additions and 9 deletions

View File

@ -225,10 +225,13 @@ var IPython = (function (IPython) {
json.output_type = "pyout";
json.metadata = content.metadata;
json.prompt_number = content.execution_count;
} else if (msg_type === "pyerr") {
json.ename = content.ename;
json.evalue = content.evalue;
json.traceback = content.traceback;
} else if (msg_type === "error") {
// pyerr message has been renamed to error,
// but the nbformat has not been updated,
// so transform back to pyerr for json.
json.output_type = "pyerr";
json = this.convert_mime_types(json, content.data);
json.metadata = this.convert_mime_types({}, content.metadata);
}
this.append_output(json);
};
@ -285,7 +288,7 @@ var IPython = (function (IPython) {
if (json.output_type === 'pyout') {
this.append_execute_result(json);
} else if (json.output_type === 'pyerr') {
this.append_pyerr(json);
this.append_error(json);
} else if (json.output_type === 'stream') {
this.append_stream(json);
}
@ -425,7 +428,7 @@ var IPython = (function (IPython) {
};
OutputArea.prototype.append_pyerr = function (json) {
OutputArea.prototype.append_error = function (json) {
var tb = json.traceback;
if (tb !== undefined && tb.length > 0) {
var s = '';

View File

@ -76,13 +76,13 @@ var IPython = (function (IPython) {
// Initialize the iopub handlers
Kernel.prototype.init_iopub_handlers = function () {
var output_types = ['stream', 'display_data', 'execute_result', 'pyerr'];
var output_msg_types = ['stream', 'display_data', 'execute_result', 'error'];
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));
for (var i=0; i < output_types.length; i++) {
this.register_iopub_handler(output_types[i], $.proxy(this._handle_output_message, this));
for (var i=0; i < output_msg_types.length; i++) {
this.register_iopub_handler(output_msg_types[i], $.proxy(this._handle_output_message, this));
}
};