spawner/src/glicid_spawner/spawner.py

28 lines
779 B
Python
Raw Normal View History

2024-01-29 17:47:47 +01:00
"""GLiCID spawner module."""
from batchspawner import SlurmSpawner
2024-02-14 10:48:56 +01:00
from traitlets import Unicode, default
from .form import options_form, options_from_form
2024-01-29 17:47:47 +01:00
class GlicidSpawner(SlurmSpawner):
"""Glicid SLURM Spawner."""
2024-02-14 10:48:56 +01:00
glicid_singleuser_cmd = Unicode(
'glicid-spawner-singleuser',
help='Glicid spawner singleuser command.',
).tag(config=True)
2024-02-14 10:48:56 +01:00
@default('batchspawner_singleuser_cmd')
def _batchspawner_singleuser_cmd_default(self):
return self.glicid_singleuser_cmd
def options_form(self) -> str:
"""JupyterHub rendered form template."""
return options_form(self.user.name)
2024-01-29 17:47:47 +01:00
def options_from_form(self, formdata) -> dict:
"""Export options from form."""
return options_from_form(formdata)