This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
/
main.py
42 lines (34 loc) · 1.49 KB
/
main.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
34
35
36
37
38
39
40
41
42
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jupyterlab_server import LabServerApp, LabConfig
from jupyter_conda.handlers import load_jupyter_server_extension
from notebook.utils import url_path_join as ujoin
import json
import os
from traitlets import Unicode
HERE = os.path.dirname(__file__)
# Turn off the Jupyter configuration system so configuration files on disk do
# not affect this app. This helps this app to truly be standalone.
os.environ["JUPYTER_NO_CONFIG"]="1"
with open(os.path.join(HERE, 'package.json')) as fid:
version = json.load(fid)['version']
class MambaNavigator(LabServerApp):
default_url = Unicode('/navigator',
help='The default URL to redirect to from `/`')
lab_config = LabConfig(
app_name = 'Mamba Navigator',
app_settings_dir = os.path.join(HERE, 'build', 'application_settings'),
app_version = version,
app_url = '/navigator',
schemas_dir = os.path.join(HERE, 'build', 'schemas'),
static_dir = os.path.join(HERE, 'build'),
templates_dir = os.path.join(HERE, 'templates'),
themes_dir = os.path.join(HERE, 'build', 'themes'),
user_settings_dir = os.path.join(HERE, 'build', 'user_settings'),
workspaces_dir = os.path.join(HERE, 'build', 'workspaces'),
)
def start(self):
load_jupyter_server_extension(self)
super().start()
if __name__ == '__main__':
MambaNavigator.launch_instance()