##// END OF EJS Templates
This feature was discussed in #6123, but it doesn't look like anything was ever incorporated into the IPython Notebook....
This feature was discussed in #6123, but it doesn't look like anything was ever incorporated into the IPython Notebook. Here's a brief overview of the changes: - Display of messages from other clients can be toggled on and off from within a notebook, either using the ``<M-m>e`` keyboard shortcut in the web UI, or through the option in the "Kernel" menu. - notebook.js controls whether messages are displayed through a callback that is invoked from kernel.js when no callbacks are available for a message. - The UI displays ``execute_input`` messages originating from an other clients in new cells at the end of the notebook. Output messages (``execute_result`` et al.) will only be displayed if a cell exists with a matching message ID. Pending design questions: - Should each ``execute_input`` message cause a new cell to be created? - Should new cells be placed at the end of the notebook, or elsewhere? If the latter, what criteria should be followed?

File last commit:

r18341:9e6b62e8
r19164:17ac8ca3
Show More
prompt_numbers.js
36 lines | 1.3 KiB | application/javascript | JavascriptLexer
Jessica B. Hamrick
Add regression tests for live notebook
r18341
// Test
casper.notebook_test(function () {
var that = this;
var set_prompt = function (i, val) {
that.evaluate(function (i, val) {
var cell = IPython.notebook.get_cell(i);
cell.set_input_prompt(val);
}, [i, val]);
};
var get_prompt = function (i) {
return that.evaluate(function (i) {
var elem = IPython.notebook.get_cell(i).element;
return elem.find('div.input_prompt').html();
}, [i]);
};
this.then(function () {
var a = 'print("a")';
var index = this.append_cell(a);
this.test.assertEquals(get_prompt(index), "In&nbsp;[&nbsp;]:", "prompt number is &nbsp; by default");
set_prompt(index, 2);
this.test.assertEquals(get_prompt(index), "In&nbsp;[2]:", "prompt number is 2");
set_prompt(index, 0);
this.test.assertEquals(get_prompt(index), "In&nbsp;[0]:", "prompt number is 0");
set_prompt(index, "*");
this.test.assertEquals(get_prompt(index), "In&nbsp;[*]:", "prompt number is *");
set_prompt(index, undefined);
this.test.assertEquals(get_prompt(index), "In&nbsp;[&nbsp;]:", "prompt number is &nbsp;");
set_prompt(index, null);
this.test.assertEquals(get_prompt(index), "In&nbsp;[&nbsp;]:", "prompt number is &nbsp;");
});
});