Adding options to Kernel.execute with a default of silent=true.

Brian Granger 14 years ago
parent 2976d8ea10
commit f306423c7e

@ -156,7 +156,7 @@ var IPython = (function (IPython) {
'clear_output': $.proxy(this._handle_clear_output, this),
'cell': this
};
var msg_id = this.kernel.execute(this.get_text(), callbacks);
var msg_id = this.kernel.execute(this.get_text(), callbacks, {silent: false});
};
@ -302,7 +302,7 @@ var IPython = (function (IPython) {
if (data['application/javascript'] !== undefined) {
json.javascript = data['application/javascript'];
}
return json;
return json;
};

@ -199,7 +199,17 @@ var IPython = (function (IPython) {
return;
}
Kernel.prototype.execute = function (code, callbacks) {
Kernel.prototype.execute = function (code, callbacks, options) {
// The options object should contain the options for the execute call. Its default
// values are:
//
// options = {
// silent : true,
// user_variables : [],
// user_expressions : {},
// allow_stdin : false
// }
//
// When calling this method pass a callbacks structure of the form:
//
// callbacks = {
@ -225,13 +235,15 @@ var IPython = (function (IPython) {
//
// The cell value will contain the a cell object that the notebook can use for the
// set_next_input payload.
var content = {
code : code,
silent : false,
silent : true,
user_variables : [],
user_expressions : {},
allow_stdin : false
};
$.extend(true, content, options)
var msg = this._get_msg("execute_request", content);
this.shell_channel.send(JSON.stringify(msg));
this.set_callbacks_for_msg(msg.header.msg_id, callbacks);

Loading…
Cancel
Save