##// END OF EJS Templates
update callback structure in js commands
MinRK -
Show More
@@ -244,17 +244,13 b' var IPython = (function (IPython) {'
244 /**
244 /**
245 * Get info on an object
245 * Get info on an object
246 *
246 *
247 * @async
248 * @param objname {string}
247 * @param objname {string}
249 * @param callback {function}
248 * @param callback {function}
250 * @method object_info
249 * @method object_info
251 *
250 *
252 * @example
251 * When calling this method, pass a callback function that expects one argument.
253 *
252 * The callback will be passed the complete `object_info_reply` message documented
254 * When calling this method pass a callback function that expects one argument.
253 * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#object-information)
255 *
256 * The callback will be passed the complete `object_info_reply` message documented in
257 * [IPython dev documentation](http://ipython.org/ipython-doc/dev/development/messaging.html#object-information)
258 */
254 */
259 Kernel.prototype.object_info = function (objname, callback) {
255 Kernel.prototype.object_info = function (objname, callback) {
260 var callbacks;
256 var callbacks;
@@ -275,16 +271,15 b' var IPython = (function (IPython) {'
275 /**
271 /**
276 * Execute given code into kernel, and pass result to callback.
272 * Execute given code into kernel, and pass result to callback.
277 *
273 *
278 * TODO: document input_request in callbacks
279 *
280 * @async
274 * @async
281 * @method execute
275 * @method execute
282 * @param {string} code
276 * @param {string} code
283 * @param [callbacks] {Object} With the optional following keys
277 * @param [callbacks] {Object} With the following keys (all optional)
284 * @param callbacks.'execute_reply' {function}
278 * @param callbacks.shell.reply {function}
285 * @param callbacks.'output' {function}
279 * @param callbacks.shell.payload.[payload_name] {function}
286 * @param callbacks.'clear_output' {function}
280 * @param callbacks.iopub.output {function}
287 * @param callbacks.'set_next_input' {function}
281 * @param callbacks.iopub.clear_output {function}
282 * @param callbacks.input {function}
288 * @param {object} [options]
283 * @param {object} [options]
289 * @param [options.silent=false] {Boolean}
284 * @param [options.silent=false] {Boolean}
290 * @param [options.user_expressions=empty_dict] {Dict}
285 * @param [options.user_expressions=empty_dict] {Dict}
@@ -306,27 +301,21 b' var IPython = (function (IPython) {'
306 * When calling this method pass a callbacks structure of the form:
301 * When calling this method pass a callbacks structure of the form:
307 *
302 *
308 * callbacks = {
303 * callbacks = {
309 * 'execute_reply': execute_reply_callback,
304 * shell : {
310 * 'output': output_callback,
305 * reply : execute_reply_callback,
311 * 'clear_output': clear_output_callback,
306 * payload : {
312 * 'set_next_input': set_next_input_callback
307 * set_next_input : set_next_input_callback,
308 * }
309 * },
310 * iopub : {
311 * output : output_callback,
312 * clear_output : clear_output_callback,
313 * },
314 * input : raw_input_callback
313 * }
315 * }
314 *
316 *
315 * The `execute_reply_callback` will be passed the content and metadata
317 * Each callback will be passed the entire message as a single arugment.
316 * objects of the `execute_reply` message documented
318 * Payload handlers will be passed the corresponding payload and the execute_reply message.
317 * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#execute)
318 *
319 * The `output_callback` will be passed `msg_type` ('stream','display_data','pyout','pyerr')
320 * of the output and the content and metadata objects of the PUB/SUB channel that contains the
321 * output:
322 *
323 * http://ipython.org/ipython-doc/dev/development/messaging.html#messages-on-the-pub-sub-socket
324 *
325 * The `clear_output_callback` will be passed a content object that contains
326 * stdout, stderr and other fields that are booleans, as well as the metadata object.
327 *
328 * The `set_next_input_callback` will be passed the text that should become the next
329 * input cell.
330 */
319 */
331 Kernel.prototype.execute = function (code, callbacks, options) {
320 Kernel.prototype.execute = function (code, callbacks, options) {
332
321
@@ -348,11 +337,8 b' var IPython = (function (IPython) {'
348 };
337 };
349
338
350 /**
339 /**
351 * When calling this method pass a function to be called with the `complete_reply` message
340 * When calling this method, pass a function to be called with the `complete_reply` message
352 * as its only argument when it arrives.
341 * as its only argument when it arrives.
353 * callbacks = {
354 * 'complete_reply': complete_reply_callback
355 * }
356 *
342 *
357 * `complete_reply` is documented
343 * `complete_reply` is documented
358 * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#complete)
344 * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#complete)
General Comments 0
You need to be logged in to leave comments. Login now