mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 12:33:02 +00:00
make Spawner.notebook_dir configurable
resolved based on user's home dir
This commit is contained in:
@@ -74,6 +74,13 @@ class Spawner(LoggingConfigurable):
|
||||
help="""The command used for starting notebooks."""
|
||||
)
|
||||
|
||||
notebook_dir = Unicode('', config=True,
|
||||
help="""The notebook directory for the single-user server
|
||||
|
||||
`~` will be expanded to the user's home directory
|
||||
"""
|
||||
)
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(Spawner, self).__init__(**kwargs)
|
||||
if self.user.state:
|
||||
@@ -129,6 +136,8 @@ class Spawner(LoggingConfigurable):
|
||||
'--hub-prefix=%s' % self.hub.server.base_url,
|
||||
'--hub-api-url=%s' % self.hub.api_url,
|
||||
]
|
||||
if self.notebook_dir:
|
||||
args.append('--notebook-dir=%s' % self.notebook_dir)
|
||||
if self.debug:
|
||||
args.append('--debug')
|
||||
return args
|
||||
|
Reference in New Issue
Block a user