Переглянути джерело

Merge pull request #999 from afshin/remove-details-inspector

Remove details inspector.
Steven Silvester 8 роки тому
батько
коміт
94616058c5

+ 0 - 3
src/console/content.ts

@@ -312,7 +312,6 @@ class ConsoleContent extends Widget {
     this.dismissCompleter();
 
     if (this._session.status === 'dead') {
-      this._inspectionHandler.handleExecuteReply(null);
       return;
     }
 
@@ -498,12 +497,10 @@ class ConsoleContent extends Widget {
     let onSuccess = (value: KernelMessage.IExecuteReplyMsg) => {
       this.executed.emit(new Date());
       if (!value) {
-        this._inspectionHandler.handleExecuteReply(null);
         return;
       }
       if (value.content.status === 'ok') {
         let content = value.content as KernelMessage.IExecuteOkReply;
-        this._inspectionHandler.handleExecuteReply(content);
         // Use deprecated payloads for backwards compatibility.
         if (content.payload && content.payload.length) {
           let setNextInput = content.payload.filter(i => {

+ 0 - 32
src/inspector/handler.ts

@@ -114,38 +114,6 @@ class InspectionHandler implements IDisposable, Inspector.IInspectable {
     clearSignalData(this);
   }
 
-  /**
-   * Update the inspector based on page outputs from the kernel.
-   *
-   * #### Notes
-   * Payloads are deprecated and there are no official interfaces for them in
-   * the kernel type definitions.
-   * See [Payloads (DEPRECATED)](http://jupyter-client.readthedocs.io/en/latest/messaging.html#payloads-deprecated).
-   */
-  handleExecuteReply(content: KernelMessage.IExecuteOkReply): void {
-    let update: Inspector.IInspectorUpdate = {
-      content: null,
-      type: 'details'
-    };
-
-    if (!content || !content.payload || !content.payload.length) {
-      this.inspected.emit(update);
-      return;
-    }
-
-    let details = content.payload.filter(i => (i as any).source === 'page')[0];
-    if (details) {
-      let bundle = (details as any).data as RenderMime.MimeMap<string>;
-      let trusted = true;
-      let widget = this._rendermime.render({ bundle, trusted });
-      update.content = widget;
-      this.inspected.emit(update);
-      return;
-    }
-
-    this.inspected.emit(update);
-  }
-
   /**
    * Handle a text changed signal from an editor.
    *

+ 1 - 9
src/inspector/plugin.ts

@@ -50,7 +50,7 @@ function activateInspector(app: JupyterLab, palette: ICommandPalette): IInspecto
 
   app.commands.addCommand(openInspectorCommand, {
     execute: openInspector,
-    label: "Open Inspector"
+    label: 'Open Inspector'
   });
 
   palette.addItem({
@@ -60,7 +60,6 @@ function activateInspector(app: JupyterLab, palette: ICommandPalette): IInspecto
 
   return inspector;
 }
- 
 
 /**
  * A namespace for private data.
@@ -76,13 +75,6 @@ namespace Private {
       name: 'Hints',
       rank: 20,
       type: 'hints'
-    },
-    {
-      className: 'jp-DetailsInspectorItem',
-      name: 'Details',
-      rank: 10,
-      remembers: true,
-      type: 'details'
     }
   ];
 }

+ 0 - 3
src/notebook/notebook/actions.ts

@@ -928,12 +928,9 @@ namespace Private {
         return (child as CodeCellWidget).execute(kernel).then(reply => {
           if (reply && reply.content.status === 'ok') {
             let content = reply.content as KernelMessage.IExecuteOkReply;
-            parent.inspectionHandler.handleExecuteReply(content);
             if (content.payload && content.payload.length) {
               handlePayload(content, parent, child);
             }
-          } else {
-            parent.inspectionHandler.handleExecuteReply(null);
           }
           return reply ? reply.content.status === 'ok' : true;
         });