Permalink
Browse files

%loadpy works in the notebook and bug with inline plotting fixed.

  • Loading branch information...
ellisonbg committed Aug 11, 2011
1 parent eaf692f commit 1de26e1397b549d01e247ec2439023b8ceadb29a
Showing with 11 additions and 8 deletions.
  1. +11 −7 IPython/frontend/html/notebook/static/js/notebook.js
  2. +0 −1 IPython/zmq/pylab/backend_inline.py
@@ -477,18 +477,22 @@ var IPython = (function (IPython) {
cell.finish_completing(content.matched_text, content.matches);
};
var payload = content.payload || [];
- this.handle_payload(payload);
+ this.handle_payload(cell, payload);
};
- Notebook.prototype.handle_payload = function (payload) {
+ Notebook.prototype.handle_payload = function (cell, payload) {
var l = payload.length;
- if (l > 0) {
- IPython.pager.clear();
- IPython.pager.expand();
- };
for (var i=0; i<l; i++) {
- IPython.pager.append_text(payload[i].text);
+ if (payload[i].source === 'IPython.zmq.page.page') {
+ IPython.pager.clear();
+ IPython.pager.expand();
+ IPython.pager.append_text(payload[i].text);
+ } else if (payload[i].source === 'IPython.zmq.zmqshell.ZMQInteractiveShell.set_next_input') {
+ var index = this.find_cell_index(cell);
+ var new_cell = this.insert_code_cell_after(index);
+ new_cell.set_code(payload[i].text);
+ }
};
};
@@ -111,7 +111,6 @@ def send_figure(fig):
sys.stdout.flush(); sys.stderr.flush()
publish_display_data(
'IPython.zmq.pylab.backend_inline.send_figure',
- 'Matplotlib Plot',
{mime : data}
)

0 comments on commit 1de26e1

Please sign in to comment.