Add support for default_url

This commit is contained in:
Shreyas Cholia
2016-03-05 12:05:58 -08:00
parent 481debcb80
commit 66a99ce881

View File

@@ -139,6 +139,13 @@ class Spawner(LoggingConfigurable):
`%U` will be expanded to the user's username
"""
)
default_url = Unicode('', config=True,
help="""The default URL for the single-user server
`%U` will be expanded to the user's username
"""
)
disable_user_config = Bool(False, config=True,
help="""Disable per-user configuration of single-user servers.
@@ -216,6 +223,10 @@ class Spawner(LoggingConfigurable):
if self.notebook_dir:
self.notebook_dir = self.notebook_dir.replace("%U",self.user.name)
args.append('--notebook-dir=%s' % self.notebook_dir)
if self.default_url:
self.default_url = self.default_url.replace("%U",self.user.name)
args.append('--NotebookApp.default_url=%s' % self.default_url)
if self.debug:
args.append('--debug')
if self.disable_user_config: