mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-15 04:00:34 +08:00
Update directview.ipynb & allowing no-callbacks in kernel.execute.
This commit is contained in:
parent
94b24d6ac9
commit
e817bfdaeb
@ -262,6 +262,7 @@ var IPython = (function (IPython) {
|
|||||||
// complete_reply message documented here:
|
// complete_reply message documented here:
|
||||||
//
|
//
|
||||||
// http://ipython.org/ipython-doc/dev/development/messaging.html#complete
|
// http://ipython.org/ipython-doc/dev/development/messaging.html#complete
|
||||||
|
callbacks = callbacks || {};
|
||||||
var content = {
|
var content = {
|
||||||
text : '',
|
text : '',
|
||||||
line : line,
|
line : line,
|
||||||
@ -303,7 +304,7 @@ var IPython = (function (IPython) {
|
|||||||
|
|
||||||
|
|
||||||
Kernel.prototype.set_callbacks_for_msg = function (msg_id, callbacks) {
|
Kernel.prototype.set_callbacks_for_msg = function (msg_id, callbacks) {
|
||||||
this._msg_callbacks[msg_id] = callbacks;
|
this._msg_callbacks[msg_id] = callbacks || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -320,7 +321,7 @@ var IPython = (function (IPython) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (content.payload !== undefined) {
|
if (content.payload !== undefined && callbacks.cell !== undefined) {
|
||||||
var payload = content.payload || [];
|
var payload = content.payload || [];
|
||||||
this._handle_payload(callbacks.cell, payload);
|
this._handle_payload(callbacks.cell, payload);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,25 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"input": [
|
"input": [
|
||||||
""
|
"from directview import interact",
|
||||||
|
"from IPython.parallel import Client"
|
||||||
|
],
|
||||||
|
"language": "python",
|
||||||
|
"outputs": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"input": [
|
||||||
|
"c = Client()",
|
||||||
|
"dv = c[:]"
|
||||||
|
],
|
||||||
|
"language": "python",
|
||||||
|
"outputs": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"input": [
|
||||||
|
"interact(dv)"
|
||||||
],
|
],
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"outputs": []
|
"outputs": []
|
||||||
|
Loading…
Reference in New Issue
Block a user