Explorar o código

Move listings example under exteensionmanager-extension package

Eric Charles %!s(int64=5) %!d(string=hai) anos
pai
achega
4670176d91

+ 0 - 23
examples/listings/Makefile

@@ -1,23 +0,0 @@
-export BLACK_LIST_URIS=https://raw.githubusercontent.com/datalayer-jupyterlab/jupyterlab-listings-example/master/blacklist_simple.json	
-export WHITE_LIST_URIS=https://raw.githubusercontent.com/datalayer-jupyterlab/jupyterlab-listings-example/master/whitelist_simple.json
-
-listings-uris:
-	@exec echo Blacklist URIs: ${BLACK_LIST_URIS}
-	@exec echo Whitelist URIs: ${WHITE_LIST_URIS}
-
-dev: listings-uris
-	@exec python main.py \
-	  --dev \
-	  --no-browser \
-	  --LabServerApp.blacklist_uris=${BLACK_LIST_URIS} \
-	  --LabServerApp.whitelist_uris=${WHITE_LIST_URIS} \
-	  --LabServerApp.listings_refresh_ms=5000
-
-watch: listings-uris
-	@exec python main.py \
-	  --dev \
-	  --no-browser \
-	  --watch \
-	  --LabServerApp.blacklist_uris=${BLACK_LIST_URIS} \
-	  --LabServerApp.whitelist_uris=${WHITE_LIST_URIS} \
-	  --LabServerApp.listings_refresh_ms=5000

+ 1 - 1
jupyterlab/extension.py

@@ -97,7 +97,7 @@ def load_jupyter_server_extension(nbapp):
     web_app = nbapp.web_app
     logger = nbapp.log
     base_url = nbapp.base_url
-
+    
     # Handle the app_dir
     app_dir = getattr(nbapp, 'app_dir', get_app_dir())
 

+ 1 - 1
jupyterlab/labapp.py

@@ -14,7 +14,7 @@ from jupyter_core.application import JupyterApp, base_aliases, base_flags
 from jupyterlab_server import slugify, WORKSPACE_EXTENSION
 from notebook.notebookapp import NotebookApp, aliases, flags
 from notebook.utils import url_path_join as ujoin
-from traitlets import Bool, Instance, Unicode
+from traitlets import Bool, Instance, Unicode, Integer
 
 from ._version import __version__
 from .debuglog import DebugLogFileMixin

+ 29 - 0
packages/extensionmanager-extension/examples/listings/Makefile

@@ -0,0 +1,29 @@
+export BLACK_LIST_URIS="https://raw.githubusercontent.com/datalayer-jupyterlab/jupyterlab-listings-example/master/blacklist_simple.json"
+export WHITE_LIST_URIS="https://raw.githubusercontent.com/datalayer-jupyterlab/jupyterlab-listings-example/master/whitelist_simple.json"
+export LISTINGS_REFRESH_MS=30000
+export LISTINGS_REQUEST_OPTS="{'timeout': 10}"
+
+listings-uris:
+	@exec echo Using blacklist URIs: ${BLACK_LIST_URIS}
+	@exec echo Using whitelist URIs: ${WHITE_LIST_URIS}
+	@exec echo Refreshing lists every ${LISTINGS_REFRESH_MS} milliseconds
+	@exec echo Using ${LISTINGS_REQUEST_OPTS} for the HTTP requests
+
+dev: listings-uris
+	@exec python main.py \
+	  --dev \
+	  --no-browser \
+	  --LabServerApp.blacklist_uris=${BLACK_LIST_URIS} \
+	  --LabServerApp.whitelist_uris=${WHITE_LIST_URIS} \
+	  --LabServerApp.listings_refresh_ms=${LISTINGS_REFRESH_MS} \
+	  --LabServerApp.listings_request_options=${LISTINGS_REQUEST_OPTS}
+
+watch: listings-uris
+	@exec python main.py \
+	  --dev \
+	  --no-browser \
+	  --watch \
+	  --LabServerApp.blacklist_uris=${BLACK_LIST_URIS} \
+	  --LabServerApp.whitelist_uris=${WHITE_LIST_URIS} \
+	  --LabServerApp.listings_refresh_ms=${LISTINGS_REFRESH_MS} \
+	  --LabServerApp.listings_request_options=${LISTINGS_REQUEST_OPTS}

+ 0 - 0
examples/listings/README.md → packages/extensionmanager-extension/examples/listings/README.md


+ 0 - 0
examples/listings/index.js → packages/extensionmanager-extension/examples/listings/index.js


+ 0 - 0
examples/listings/jupyter.png → packages/extensionmanager-extension/examples/listings/jupyter.png


+ 0 - 0
examples/listings/list/blacklist.json → packages/extensionmanager-extension/examples/listings/list/blacklist.json


+ 0 - 0
examples/listings/list/whitelist.json → packages/extensionmanager-extension/examples/listings/list/whitelist.json


+ 0 - 0
examples/listings/main.py → packages/extensionmanager-extension/examples/listings/main.py


+ 1 - 1
examples/listings/package.json → packages/extensionmanager-extension/examples/listings/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "@jupyterlab/example-listings",
+  "name": "@jupyterlab/listings-example",
   "version": "2.0.0",
   "private": true,
   "scripts": {

+ 0 - 0
examples/listings/settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings → packages/extensionmanager-extension/examples/listings/settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings


+ 0 - 0
examples/listings/templates/error.html → packages/extensionmanager-extension/examples/listings/templates/error.html


+ 0 - 0
examples/listings/templates/index.html → packages/extensionmanager-extension/examples/listings/templates/index.html


+ 0 - 0
examples/listings/webpack.config.js → packages/extensionmanager-extension/examples/listings/webpack.config.js