mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-14 05:23:01 +00:00
run ruff via pre-commit
This commit is contained in:
@@ -254,14 +254,15 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from IPython.display import display, HTML\n",
|
||||
"from IPython.display import HTML, display\n",
|
||||
"\n",
|
||||
"full_accept_url = f\"{hub_host}{code_info['accept_url']}\"\n",
|
||||
"\n",
|
||||
"display(\n",
|
||||
" HTML(f\"\"\"\n",
|
||||
" <a href='{full_accept_url}'>share this link to grant access</a>\n",
|
||||
" \"\"\")\n",
|
||||
")\n"
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -347,7 +348,9 @@
|
||||
"from urllib.parse import urlencode\n",
|
||||
"\n",
|
||||
"this_notebook_url = server_base_url + \"lab/tree/share-api.ipynb\"\n",
|
||||
"this_notebook_accept_url = full_accept_url + \"&\" + urlencode({\"next\": this_notebook_url})\n",
|
||||
"this_notebook_accept_url = (\n",
|
||||
" full_accept_url + \"&\" + urlencode({\"next\": this_notebook_url})\n",
|
||||
")\n",
|
||||
"print(this_notebook_accept_url)\n",
|
||||
"\n",
|
||||
"display(\n",
|
||||
@@ -355,7 +358,7 @@
|
||||
" share <a href='{this_notebook_accept_url}'>this link</a>\n",
|
||||
" to grant access and direct users to this notebook\n",
|
||||
" \"\"\")\n",
|
||||
")\n"
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -488,16 +491,16 @@
|
||||
"import json\n",
|
||||
"\n",
|
||||
"options = {\n",
|
||||
" \"scopes\": [\n",
|
||||
" f\"access:servers!server={user_server}\", # access the server (default)\n",
|
||||
" f\"servers!server={user_server}\", # start/stop the server\n",
|
||||
" f\"shares!server={user_server}\", # further share the server with others\n",
|
||||
" ],\n",
|
||||
" \"expires_in\": 3600, # code expires in one hour\n",
|
||||
" \"scopes\": [\n",
|
||||
" f\"access:servers!server={user_server}\", # access the server (default)\n",
|
||||
" f\"servers!server={user_server}\", # start/stop the server\n",
|
||||
" f\"shares!server={user_server}\", # further share the server with others\n",
|
||||
" ],\n",
|
||||
" \"expires_in\": 3600, # code expires in one hour\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"session.post(share_codes_url, data=json.dumps(options))\n"
|
||||
"session.post(share_codes_url, data=json.dumps(options))"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -598,7 +601,7 @@
|
||||
" \"user\": \"shared-with\",\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"session.patch(shares_url, data=json.dumps(options))\n"
|
||||
"session.patch(shares_url, data=json.dumps(options))"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user