mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 19:43:01 +00:00
Edit spacing in singleuser.py
This commit is contained in:
@@ -39,16 +39,20 @@ from jupyterhub import __version__
|
||||
from .services.auth import HubAuth, HubAuthenticated
|
||||
from .utils import url_path_join
|
||||
|
||||
|
||||
# Authenticate requests with the Hub
|
||||
|
||||
|
||||
class HubAuthenticatedHandler(HubAuthenticated):
|
||||
"""Class we are going to patch-in for authentication with the Hub"""
|
||||
@property
|
||||
def hub_auth(self):
|
||||
return self.settings['hub_auth']
|
||||
|
||||
@property
|
||||
def hub_users(self):
|
||||
return { self.settings['user'] }
|
||||
|
||||
@property
|
||||
def hub_groups(self):
|
||||
if self.settings['group']:
|
||||
@@ -90,7 +94,7 @@ class JupyterHubLogoutHandler(LogoutHandler):
|
||||
# register new hub related command-line aliases
|
||||
aliases = dict(notebook_aliases)
|
||||
aliases.update({
|
||||
'user' : 'SingleUserNotebookApp.user',
|
||||
'user': 'SingleUserNotebookApp.user',
|
||||
'group': 'SingleUserNotebookApp.group',
|
||||
'cookie-name': 'HubAuth.cookie_name',
|
||||
'hub-prefix': 'SingleUserNotebookApp.hub_prefix',
|
||||
@@ -124,6 +128,7 @@ Control Panel</a>
|
||||
{% endblock logo %}
|
||||
"""
|
||||
|
||||
|
||||
def _exclude_home(path_list):
|
||||
"""Filter out any entries in a path list that are in my home directory.
|
||||
|
||||
@@ -150,6 +155,7 @@ class SingleUserNotebookApp(NotebookApp):
|
||||
|
||||
user = CUnicode().tag(config=True)
|
||||
group = CUnicode().tag(config=True)
|
||||
|
||||
@observe('user')
|
||||
def _user_changed(self, change):
|
||||
self.log.name = change.new
|
||||
@@ -157,12 +163,14 @@ class SingleUserNotebookApp(NotebookApp):
|
||||
hub_host = Unicode().tag(config=True)
|
||||
|
||||
hub_prefix = Unicode('/hub/').tag(config=True)
|
||||
|
||||
@default('hub_prefix')
|
||||
def _hub_prefix_default(self):
|
||||
base_url = os.environ.get('JUPYTERHUB_BASE_URL') or '/'
|
||||
return base_url + 'hub/'
|
||||
|
||||
hub_api_url = Unicode().tag(config=True)
|
||||
|
||||
@default('hub_api_url')
|
||||
def _hub_api_url_default(self):
|
||||
return os.environ.get('JUPYTERHUB_API_URL') or 'http://127.0.0.1:8081/hub/api'
|
||||
|
Reference in New Issue
Block a user