Add Spawner form

If Spawner.options_form is specified, a form providing input controls is shown to the user prior to launch.

Spawners access the result via the `self.user_options` dict.

The default spawners offer no form.
This commit is contained in:
Min RK
2015-12-16 15:52:53 +01:00
parent 675f19b5cb
commit ba634354dd
8 changed files with 112 additions and 8 deletions

View File

@@ -107,7 +107,8 @@ class User(HasTraits):
return quote(self.name, safe='@')
@gen.coroutine
def spawn(self, spawner_class, base_url='/', hub=None, config=None, authenticator=None):
def spawn(self, spawner_class, base_url='/', hub=None, config=None,
authenticator=None, options=None):
"""Start the user's spawner"""
db = self.db
if hub is None:
@@ -129,6 +130,7 @@ class User(HasTraits):
hub=hub,
db=db,
authenticator=authenticator,
user_options=options or {},
)
# we are starting a new server, make sure it doesn't restore state
spawner.clear_state()