Skip to content

Commit

Permalink
Add docstring documenting the intended use of LabHubApp.
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-r-rose committed Jun 8, 2019
1 parent a33f18d commit fbdaeff
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions jupyterlab/labhubapp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import warnings

from traitlets import default

Expand All @@ -12,17 +11,25 @@
raise ImportError('You must have jupyterhub installed for this to work.')
else:
class SingleUserLabApp(SingleUserNotebookApp, LabApp):

"""
A sublcass of JupyterHub's SingleUserNotebookApp which includes LabApp
as a mixin. This makes the LabApp configurables available to the spawned
jupyter server.
If you don't need to change any of the configurables from their default
values, then this class is not necessary, and you can deploy JupyterLab
by ensuring that its server extension is enabled and setting the
`Spawner.default_url` to '/lab'.
If you do need to configure JupyterLab, then use this application by
setting `Spawner.cmd = ['jupyter-labhub']`.
"""
@default("default_url")
def _default_url(self):
"""when using jupyter-labhub, jupyterlab is default ui"""
return "/lab"

def init_webapp(self, *args, **kwargs):
warnings.warn(
"SingleUserLabApp is deprecated, use SingleUserNotebookApp and set " + \
"c.Spawner.default_url = '/lab' in jupyterhub_config.py", DeprecationWarning
)
super().init_webapp(*args, **kwargs)


Expand Down

0 comments on commit fbdaeff

Please sign in to comment.