/
__init__.py
33 lines (21 loc) · 819 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import json
import os.path as osp
from .handlers import setup_handlers
from ._version import __version__
HERE = osp.abspath(osp.dirname(__file__))
with open(osp.join(HERE, "labextension", "package.json")) as fid:
data = json.load(fid)
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": data["name"]}]
def _jupyter_server_extension_paths():
return [{"module": "jupyterlab_code_formatter"}]
def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend extension.
Parameters
----------
lab_app: jupyterlab.labapp.LabApp
JupyterLab application instance
"""
setup_handlers(server_app.web_app)
# For backward compatibility
load_jupyter_server_extension = _load_jupyter_server_extension