Add notebook directory configuration

This commit is contained in:
Benoît Seignovert 2024-02-26 14:54:56 +01:00
parent c67e8742c8
commit dc750031db
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 23 additions and 1 deletions

View file

@ -4,7 +4,7 @@ import asyncio
import re
from batchspawner import JobStatus, SlurmSpawner
from traitlets import Integer, Unicode, default
from traitlets import Bool, Integer, Unicode, default
from .form import options_form, options_from_form
from .progress import ElapseTime, get_progress
@ -13,6 +13,21 @@ from .progress import ElapseTime, get_progress
class GlicidSpawner(SlurmSpawner):
"""Glicid SLURM Spawner."""
disable_user_config = Bool(
True,
help='Disable per-user configuration of single-user servers.',
).tag(config=True)
notebook_dir = Unicode(
'/',
help='Path to the notebook directory for the single-user server.',
).tag(config=True)
@default('default_url')
def _default_url_default(self) -> str:
"""The URL the single-user server should start in."""
return '/tree' + self.user_options.get('workdir', '/home/{username}')
batchspawner_singleuser_cmd = Unicode(
'glicid-spawner-singleuser',
help='Spawner singleuser command.',