-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
from ._version import __version__ | ||
|
||
import os | ||
import json | ||
import tornado | ||
from jupyter_server.base.handlers import JupyterHandler | ||
|
||
|
||
def _jupyter_labextension_paths(): | ||
return [{ | ||
"src": "labextension", | ||
"dest": "brevmakesjupyterlookbetter" | ||
}] | ||
|
||
|
||
def _jupyter_server_extension_paths(): | ||
return [{ | ||
"module": "brevmakesjupyterlookbetter" | ||
}] | ||
|
||
|
||
class BMJLBExtensionHandler(JupyterHandler): | ||
def get(self): | ||
# print VERB_ env vars: | ||
self.finish(json.dumps({ | ||
k: v for k, v in os.environ.items() if k.startswith("VERB_") | ||
})) | ||
|
||
def _load_jupyter_server_extension(serverapp): | ||
handlers = [("/brevmakesjupyterlookbetter", BMJLBExtensionHandler)] | ||
serverapp.web_app.add_handlers(".*$", handlers) |