##// END OF EJS Templates
Adding options to Kernel.execute with a default of silent=true.
Brian Granger -
Show More
@@ -156,7 +156,7 b' var IPython = (function (IPython) {'
156 'clear_output': $.proxy(this._handle_clear_output, this),
156 'clear_output': $.proxy(this._handle_clear_output, this),
157 'cell': this
157 'cell': this
158 };
158 };
159 var msg_id = this.kernel.execute(this.get_text(), callbacks);
159 var msg_id = this.kernel.execute(this.get_text(), callbacks, {silent: false});
160 };
160 };
161
161
162
162
@@ -302,7 +302,7 b' var IPython = (function (IPython) {'
302 if (data['application/javascript'] !== undefined) {
302 if (data['application/javascript'] !== undefined) {
303 json.javascript = data['application/javascript'];
303 json.javascript = data['application/javascript'];
304 }
304 }
305 return json;
305 return json;
306 };
306 };
307
307
308
308
@@ -199,7 +199,17 b' var IPython = (function (IPython) {'
199 return;
199 return;
200 }
200 }
201
201
202 Kernel.prototype.execute = function (code, callbacks) {
202 Kernel.prototype.execute = function (code, callbacks, options) {
203 // The options object should contain the options for the execute call. Its default
204 // values are:
205 //
206 // options = {
207 // silent : true,
208 // user_variables : [],
209 // user_expressions : {},
210 // allow_stdin : false
211 // }
212 //
203 // When calling this method pass a callbacks structure of the form:
213 // When calling this method pass a callbacks structure of the form:
204 //
214 //
205 // callbacks = {
215 // callbacks = {
@@ -225,13 +235,15 b' var IPython = (function (IPython) {'
225 //
235 //
226 // The cell value will contain the a cell object that the notebook can use for the
236 // The cell value will contain the a cell object that the notebook can use for the
227 // set_next_input payload.
237 // set_next_input payload.
238
228 var content = {
239 var content = {
229 code : code,
240 code : code,
230 silent : false,
241 silent : true,
231 user_variables : [],
242 user_variables : [],
232 user_expressions : {},
243 user_expressions : {},
233 allow_stdin : false
244 allow_stdin : false
234 };
245 };
246 $.extend(true, content, options)
235 var msg = this._get_msg("execute_request", content);
247 var msg = this._get_msg("execute_request", content);
236 this.shell_channel.send(JSON.stringify(msg));
248 this.shell_channel.send(JSON.stringify(msg));
237 this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
249 this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
General Comments 0
You need to be logged in to leave comments. Login now