Skip to content

Commit

Permalink
Merge pull request #9568 from afshin/hub-integration
Browse files Browse the repository at this point in the history
Fix integration with JupyterHub
  • Loading branch information
blink1073 committed Jan 6, 2021
2 parents d2e6a23 + fbd878e commit d5a6043
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jupyterlab/labapp.py
Expand Up @@ -730,6 +730,10 @@ def initialize_handlers(self):
self.handlers.extend(handlers)
super().initialize_handlers()

def initialize(self, argv=None):
"""Subclass because the ExtensionApp.initialize() method does not take arguments"""
super().initialize()

#-----------------------------------------------------------------------------
# Main entry point
#-----------------------------------------------------------------------------
Expand Down
19 changes: 18 additions & 1 deletion jupyterlab/labhubapp.py
Expand Up @@ -59,6 +59,8 @@
}
)



if make_singleuser_app:

class SingleUserNotebookMixin(LabApp):
Expand Down Expand Up @@ -510,8 +512,23 @@ def get_page(name):
env.loader = ChoiceLoader([FunctionLoader(get_page), orig_loader])



# Overrides for Jupyter Server Extension config
class OverrideSingleUserNotebookApp(SingleUserNotebookApp):
name = 'labhub'

# Disable the default jupyterlab extension and enable ourself
serverapp_config = {
"open_browser": True,
"jpserver_extensions": { "jupyterlab": False, "jupyterlab.labhubapp": True }
}


load_jupyter_server_extension = OverrideSingleUserNotebookApp._load_jupyter_server_extension


def main(argv=None):
return SingleUserNotebookApp.launch_instance(argv)
return OverrideSingleUserNotebookApp.launch_instance(argv)


if __name__ == "__main__":
Expand Down

0 comments on commit d5a6043

Please sign in to comment.