From a71823c5ab802e9beeb0f5d5f7e21571472b1901 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Sun, 18 Apr 2021 21:23:03 -0700 Subject: [PATCH] DOC: Conform to numpydoc. Minor syntax update --- jupyterhub/dbutil.py | 9 +++------ jupyterhub/services/auth.py | 12 ++++++++---- jupyterhub/spawner.py | 2 +- jupyterhub/tests/utils.py | 5 ++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/jupyterhub/dbutil.py b/jupyterhub/dbutil.py index 703de8f4..e4d8b0a1 100644 --- a/jupyterhub/dbutil.py +++ b/jupyterhub/dbutil.py @@ -26,10 +26,9 @@ def write_alembic_ini(alembic_ini='alembic.ini', db_url='sqlite:///jupyterhub.sq Parameters ---------- - - alembic_ini: str + alembic_ini : str path to the alembic.ini file that should be written. - db_url: str + db_url : str The SQLAlchemy database url, e.g. `sqlite:///jupyterhub.sqlite`. """ with open(ALEMBIC_INI_TEMPLATE_PATH) as f: @@ -58,13 +57,11 @@ def _temp_alembic_ini(db_url): Parameters ---------- - - db_url: str + db_url : str The SQLAlchemy database url, e.g. `sqlite:///jupyterhub.sqlite`. Returns ------- - alembic_ini: str The path to the temporary alembic.ini that we have created. This file will be cleaned up on exit from the context manager. diff --git a/jupyterhub/services/auth.py b/jupyterhub/services/auth.py index 7b7320cb..bcc8a57b 100644 --- a/jupyterhub/services/auth.py +++ b/jupyterhub/services/auth.py @@ -668,12 +668,15 @@ class HubOAuth(HubAuth): Parameters ---------- - handler (RequestHandler): A tornado RequestHandler - next_url (str): The page to redirect to on successful login + handler : RequestHandler + A tornado RequestHandler + next_url : str + The page to redirect to on successful login Returns ------- - state (str): The OAuth state that has been stored in the cookie (url safe, base64-encoded) + state : str + The OAuth state that has been stored in the cookie (url safe, base64-encoded) """ extra_state = {} if handler.get_cookie(self.state_cookie_name): @@ -710,7 +713,8 @@ class HubOAuth(HubAuth): Parameters ---------- - next_url (str): The URL of the page to redirect to on successful login. + next_url : str + The URL of the page to redirect to on successful login. Returns ------- diff --git a/jupyterhub/spawner.py b/jupyterhub/spawner.py index dc335d47..ead537d6 100644 --- a/jupyterhub/spawner.py +++ b/jupyterhub/spawner.py @@ -729,7 +729,7 @@ class Spawner(LoggingConfigurable): Returns ------- state: dict - a JSONable dict of state + a JSONable dict of state """ state = {} return state diff --git a/jupyterhub/tests/utils.py b/jupyterhub/tests/utils.py index e48d30b5..10a8c0ba 100644 --- a/jupyterhub/tests/utils.py +++ b/jupyterhub/tests/utils.py @@ -70,9 +70,8 @@ def check_db_locks(func): The decorator relies on an instance of JupyterHubApp being the first argument to the decorated function. - Example - ------- - + Examples + -------- @check_db_locks def api_request(app, *api_path, **kwargs):