Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 1de26e1397b549d01e247ec2439023b8ceadb29a 1 parent eaf692f
Brian E. Granger authored August 11, 2011
18  IPython/frontend/html/notebook/static/js/notebook.js
@@ -477,18 +477,22 @@ var IPython = (function (IPython) {
477 477
             cell.finish_completing(content.matched_text, content.matches);
478 478
         };
479 479
         var payload = content.payload || [];
480  
-        this.handle_payload(payload);
  480
+        this.handle_payload(cell, payload);
481 481
     };
482 482
 
483 483
 
484  
-    Notebook.prototype.handle_payload = function (payload) {
  484
+    Notebook.prototype.handle_payload = function (cell, payload) {
485 485
         var l = payload.length;
486  
-        if (l > 0) {
487  
-            IPython.pager.clear();
488  
-            IPython.pager.expand();
489  
-        };
490 486
         for (var i=0; i<l; i++) {
491  
-            IPython.pager.append_text(payload[i].text);
  487
+            if (payload[i].source === 'IPython.zmq.page.page') {
  488
+                IPython.pager.clear();
  489
+                IPython.pager.expand();
  490
+                IPython.pager.append_text(payload[i].text);
  491
+            } else if (payload[i].source === 'IPython.zmq.zmqshell.ZMQInteractiveShell.set_next_input') {
  492
+                var index = this.find_cell_index(cell);
  493
+                var new_cell = this.insert_code_cell_after(index);
  494
+                new_cell.set_code(payload[i].text);
  495
+            }
492 496
         };
493 497
     };
494 498
 
1  IPython/zmq/pylab/backend_inline.py
@@ -111,7 +111,6 @@ def send_figure(fig):
111 111
     sys.stdout.flush(); sys.stderr.flush()
112 112
     publish_display_data(
113 113
         'IPython.zmq.pylab.backend_inline.send_figure',
114  
-        'Matplotlib Plot',
115 114
         {mime : data}
116 115
     )
117 116
 

0 notes on commit 1de26e1

Please sign in to comment.
Something went wrong with that request. Please try again.