mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
pyerr -> error
This commit is contained in:
parent
38c76aa913
commit
5fb9837f5a
@ -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 = '';
|
||||
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user