From d216a6414acdfa91732d528a49ea63b506778e42 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 29 May 2024 23:19:57 +0100 Subject: [PATCH 1/3] simple extension example: use _jupyter_server_extension_points `_jupyter_server_extension_paths` is deprecated --- examples/simple/simple_ext1/__init__.py | 5 ++++- examples/simple/simple_ext11/__init__.py | 5 ++++- examples/simple/simple_ext2/__init__.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/simple/simple_ext1/__init__.py b/examples/simple/simple_ext1/__init__.py index 7b0c65c96f..47b93f02e3 100644 --- a/examples/simple/simple_ext1/__init__.py +++ b/examples/simple/simple_ext1/__init__.py @@ -1,5 +1,8 @@ from .application import SimpleApp1 -def _jupyter_server_extension_paths(): +def _jupyter_server_extension_points(): return [{"module": "simple_ext1.application", "app": SimpleApp1}] + + +_jupyter_server_extension_paths = _jupyter_server_extension_points diff --git a/examples/simple/simple_ext11/__init__.py b/examples/simple/simple_ext11/__init__.py index 66194e3e10..ad295e7e29 100644 --- a/examples/simple/simple_ext11/__init__.py +++ b/examples/simple/simple_ext11/__init__.py @@ -3,5 +3,8 @@ from .application import SimpleApp11 -def _jupyter_server_extension_paths(): +def _jupyter_server_extension_points(): return [{"module": "simple_ext11.application", "app": SimpleApp11}] + + +_jupyter_server_extension_paths = _jupyter_server_extension_points diff --git a/examples/simple/simple_ext2/__init__.py b/examples/simple/simple_ext2/__init__.py index cf7dfabb3c..abf1776bde 100644 --- a/examples/simple/simple_ext2/__init__.py +++ b/examples/simple/simple_ext2/__init__.py @@ -3,7 +3,10 @@ from .application import SimpleApp2 -def _jupyter_server_extension_paths(): +def _jupyter_server_extension_points(): return [ {"module": "simple_ext2.application", "app": SimpleApp2}, ] + + +_jupyter_server_extension_paths = _jupyter_server_extension_points From 6d1fd9e59be2af45e6fc468dabb796b411bac0da Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 29 May 2024 23:23:50 +0100 Subject: [PATCH 2/3] `static/simple_ext11/test.html` doesn't exist --- examples/simple/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/simple/README.md b/examples/simple/README.md index ad4484ec25..77f10be9d2 100644 --- a/examples/simple/README.md +++ b/examples/simple/README.md @@ -187,8 +187,6 @@ open http://localhost:8888/ # TODO Fix Default URL, it does not show on startup. # Home page as defined by default_url = '/default'. open http://localhost:8888/simple_ext11/default -# HTML static page. -open http://localhost:8888/static/simple_ext11/test.html # Content from Handlers. open http://localhost:8888/simple_ext11/params/test?var1=foo # Content from Template. From da6e6db21499801e0ca2a44bee0f76599b00c9df Mon Sep 17 00:00:00 2001 From: Simon Li Date: Fri, 31 May 2024 15:43:11 +0100 Subject: [PATCH 3/3] Remove `_jupyter_server_extension_paths` from simple examples --- examples/simple/simple_ext1/__init__.py | 3 --- examples/simple/simple_ext11/__init__.py | 3 --- examples/simple/simple_ext2/__init__.py | 3 --- 3 files changed, 9 deletions(-) diff --git a/examples/simple/simple_ext1/__init__.py b/examples/simple/simple_ext1/__init__.py index 47b93f02e3..f1b750f080 100644 --- a/examples/simple/simple_ext1/__init__.py +++ b/examples/simple/simple_ext1/__init__.py @@ -3,6 +3,3 @@ def _jupyter_server_extension_points(): return [{"module": "simple_ext1.application", "app": SimpleApp1}] - - -_jupyter_server_extension_paths = _jupyter_server_extension_points diff --git a/examples/simple/simple_ext11/__init__.py b/examples/simple/simple_ext11/__init__.py index ad295e7e29..2da9cc1925 100644 --- a/examples/simple/simple_ext11/__init__.py +++ b/examples/simple/simple_ext11/__init__.py @@ -5,6 +5,3 @@ def _jupyter_server_extension_points(): return [{"module": "simple_ext11.application", "app": SimpleApp11}] - - -_jupyter_server_extension_paths = _jupyter_server_extension_points diff --git a/examples/simple/simple_ext2/__init__.py b/examples/simple/simple_ext2/__init__.py index abf1776bde..d56053a66a 100644 --- a/examples/simple/simple_ext2/__init__.py +++ b/examples/simple/simple_ext2/__init__.py @@ -7,6 +7,3 @@ def _jupyter_server_extension_points(): return [ {"module": "simple_ext2.application", "app": SimpleApp2}, ] - - -_jupyter_server_extension_paths = _jupyter_server_extension_points