mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 21:13:01 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -10,7 +10,7 @@ from jupyter_client.localinterfaces import public_ips
|
|||||||
|
|
||||||
|
|
||||||
def create_dir_hook(spawner):
|
def create_dir_hook(spawner):
|
||||||
""" Create directory """
|
"""Create directory"""
|
||||||
username = spawner.user.name # get the username
|
username = spawner.user.name # get the username
|
||||||
volume_path = os.path.join('/volumes/jupyterhub', username)
|
volume_path = os.path.join('/volumes/jupyterhub', username)
|
||||||
if not os.path.exists(volume_path):
|
if not os.path.exists(volume_path):
|
||||||
@@ -20,7 +20,7 @@ def create_dir_hook(spawner):
|
|||||||
|
|
||||||
|
|
||||||
def clean_dir_hook(spawner):
|
def clean_dir_hook(spawner):
|
||||||
""" Delete directory """
|
"""Delete directory"""
|
||||||
username = spawner.user.name # get the username
|
username = spawner.user.name # get the username
|
||||||
temp_path = os.path.join('/volumes/jupyterhub', username, 'temp')
|
temp_path = os.path.join('/volumes/jupyterhub', username, 'temp')
|
||||||
if os.path.exists(temp_path) and os.path.isdir(temp_path):
|
if os.path.exists(temp_path) and os.path.isdir(temp_path):
|
||||||
|
@@ -7,10 +7,9 @@ const withAPI = withProps(() => ({
|
|||||||
data.json()
|
data.json()
|
||||||
),
|
),
|
||||||
updateGroups: (offset, limit) =>
|
updateGroups: (offset, limit) =>
|
||||||
jhapiRequest(
|
jhapiRequest(`/groups?offset=${offset}&limit=${limit}`, "GET").then(
|
||||||
`/groups?offset=${offset}&limit=${limit}`,
|
(data) => data.json()
|
||||||
"GET"
|
),
|
||||||
).then((data) => data.json()),
|
|
||||||
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
|
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
|
||||||
startServer: (name) => jhapiRequest("/users/" + name + "/server", "POST"),
|
startServer: (name) => jhapiRequest("/users/" + name + "/server", "POST"),
|
||||||
stopServer: (name) => jhapiRequest("/users/" + name + "/server", "DELETE"),
|
stopServer: (name) => jhapiRequest("/users/" + name + "/server", "DELETE"),
|
||||||
|
@@ -46,7 +46,7 @@ class GroupListAPIHandler(_GroupAPIHandler):
|
|||||||
|
|
||||||
@needs_scope('admin:groups')
|
@needs_scope('admin:groups')
|
||||||
async def post(self):
|
async def post(self):
|
||||||
"""POST creates Multiple groups """
|
"""POST creates Multiple groups"""
|
||||||
model = self.get_json_body()
|
model = self.get_json_body()
|
||||||
if not model or not isinstance(model, dict) or not model.get('groups'):
|
if not model or not isinstance(model, dict) or not model.get('groups'):
|
||||||
raise web.HTTPError(400, "Must specify at least one group to create")
|
raise web.HTTPError(400, "Must specify at least one group to create")
|
||||||
|
@@ -314,7 +314,7 @@ class User(Base):
|
|||||||
|
|
||||||
|
|
||||||
class Spawner(Base):
|
class Spawner(Base):
|
||||||
""""State about a Spawner"""
|
""" "State about a Spawner"""
|
||||||
|
|
||||||
__tablename__ = 'spawners'
|
__tablename__ = 'spawners'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user