add basic CLI and config file support

See `jupyterhub -h` for common shortcuts

default config file: `jupyter_hub_config.py`
generate config file with: `jupyterhub --generate-config`
non-default config file: `jupyterhub -f myconfig.py`
This commit is contained in:
MinRK
2014-09-16 14:47:48 -07:00
parent e7f67bfc4f
commit 83e9762845
4 changed files with 139 additions and 11 deletions

View File

@@ -49,11 +49,9 @@ class Spawner(LoggingConfigurable):
self._env_key(env, 'API_TOKEN', self.api_token)
return env
cmd = List(Unicode, config=True,
cmd = List(Unicode, default_value=['jupyterhub-singleuser'], config=True,
help="""The command used for starting notebooks."""
)
def _cmd_default(self):
return ['jupyterhub-singleuser']
@classmethod
def fromJSON(cls, state, **kwargs):
@@ -183,8 +181,8 @@ class LocalProcessSpawner(Spawner):
set_user = Enum(['sudo', 'setuid'], default_value='setuid', config=True,
help="""scheme for setting the user of the spawned process
sudo can be more prudently restricted,
but setuid is simpler for a server run as root
'sudo' can be more prudently restricted,
but 'setuid' is simpler for a server run as root
"""
)
def _set_user_changed(self, name, old, new):