Selaa lähdekoodia

Merge branch 'execution' of https://github.com/jasongrout/jupyter-js-plugins into execution

Jason Grout 9 vuotta sitten
vanhempi
commit
34c65acdd6
1 muutettua tiedostoa jossa 10 lisäystä ja 6 poistoa
  1. 10 6
      src/notebook/plugin.ts

+ 10 - 6
src/notebook/plugin.ts

@@ -67,7 +67,7 @@ class SessionStoreMapping {
   public services: IServicesProvider;
 }
 
-function messageToModel(msg: IKernelMessage) {  
+function messageToModel(msg: IKernelMessage) {
   let m: Output = msg.content;
   let type = msg.header.msg_type;
   if (type === 'execute_result') {
@@ -82,7 +82,11 @@ function executeSelectedCell(model: NotebookModel, session: INotebookSession)  {
   let cell = model.cells.get(model.selectedCellIndex);
   if (isCodeCell(cell)) {
     let exRequest = {
-      code: cell.input.textEditor.text
+      code: cell.input.textEditor.text,
+      silent: false,
+      store_history: true,
+      stop_on_error: true,
+      allow_stdin: true
     };
     let output = cell.output;
     console.log(`executing`, exRequest)
@@ -97,7 +101,7 @@ function executeSelectedCell(model: NotebookModel, session: INotebookSession)  {
       }
     });
     ex.onReply = (msg => {console.log('a', msg)});
-    ex.onDone = (msg => {console.log('b', msg)});    
+    ex.onDone = (msg => {console.log('b', msg)});
   }
 }
 
@@ -106,12 +110,12 @@ function executeSelectedCell(model: NotebookModel, session: INotebookSession)  {
  */
 export
 class NotebookFileHandler extends AbstractFileHandler {
-  
+
   constructor(contents: IContentsManager, session: INotebookSessionManager) {
     super(contents);
     this.session = session;
   }
-  
+
   /**
    * Get the list of file extensions supported by the handler.
    */
@@ -158,7 +162,7 @@ class NotebookFileHandler extends AbstractFileHandler {
     populateNotebookModel(nbWidget.model, nbData);
     return Promise.resolve();
   }
-  
+
   session: INotebookSessionManager;
 }