From 2c7b3ec17c0dbf6885fad8f131c53a49e4cbc913 Mon Sep 17 00:00:00 2001 From: Arthur Borem Date: Fri, 22 Aug 2025 10:23:29 -0500 Subject: [PATCH] Changes single backticks to double backticks when not referencing a class or module --- src/pardner/services/base.py | 26 +++++++++++++------------- src/pardner/services/tumblr.py | 6 +++--- src/pardner/services/utils.py | 9 ++++++--- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/pardner/services/base.py b/src/pardner/services/base.py index 90c4598..86e78a3 100644 --- a/src/pardner/services/base.py +++ b/src/pardner/services/base.py @@ -42,10 +42,10 @@ def __init__( :param service_name: Name of the service for which the transfer is being built. :param client_id: Client identifier given by the OAuth provider upon registration. :param redirect_uri: The registered callback URI. - :param supported_verticals: The `Vertical`s that can be fetched on the service. - :param client_secret: The `client_secret` paired to the `client_id`. + :param supported_verticals: The :class:`Vertical`s that can be fetched on the service. + :param client_secret: The ``client_secret`` paired to the ``client_id``. :param state: State string used to prevent CSRF and identify flow. - :param verticals: The `Vertical`s for which the transfer service has + :param verticals: The :class:`Vertical`s for which the transfer service has appropriate scope to fetch. """ self._client_secret = client_secret @@ -74,7 +74,7 @@ def scope(self, new_scope: Iterable[str]) -> None: """ Sets the scope of the transfer service flow. Some services have specific requirements for the format of the scope - string (e.g., scopes have to be comma separated, or `+` separated). + string (e.g., scopes have to be comma separated, or ``+`` separated). :param new_scope: The new scopes that should be set for the transfer service. @@ -89,7 +89,7 @@ def verticals(self) -> set[Vertical]: def verticals(self, verticals: Iterable[Vertical]) -> None: """ :raises: :class:`UnsupportedVerticalException`: if one or more of the - `verticals` are not supported by the service. + ``verticals`` are not supported by the service. """ unsupported_verticals = [ vertical @@ -156,14 +156,14 @@ def add_verticals( """ Adds to the verticals being requested. - :param verticals: `Vertical`s that should be added to service. + :param verticals: :class:`Vertical`s that should be added to service. :param should_reauth: Whether or not the service should unauthorize itself to - start a new session with added scopes corresponding to `verticals`. + start a new session with added scopes corresponding to ``verticals``. - :returns: Whether add was successful without reauthorization (`True`) or not - (`False`). + :returns: Whether add was successful without reauthorization (``True``) or not + (``False``). - :raises: :class:`UnsupportedVerticalException`: if `should_reauth` is not + :raises: :class:`UnsupportedVerticalException`: if ``should_reauth`` is not passed and the current scopes are insufficient, this exception is raised. """ new_verticals = set(verticals) - self.verticals @@ -198,11 +198,11 @@ def fetch_token( ) -> dict[str, Any]: """ Once the end-user authorizes the application to access their data, the - resource server sends a request to `redirect_uri` with the authorization code as + resource server sends a request to ``redirect_uri`` with the authorization code as a parameter. Using this authorization code, this method makes a request to the resource server to obtain the access token. - One of either `code` or `authorization_response` must not be None. + One of either ``code`` or ``authorization_response`` must not be None. :param code: the code obtained from parsing the callback URL which the end-user's browser redirected to. @@ -237,7 +237,7 @@ def scope_for_verticals(self, verticals: Iterable[Vertical]) -> set[str]: :param verticals: The verticals for which scopes are being requested. - :returns: Scope names corresponding to `verticals`. + :returns: Scope names corresponding to ``verticals``. """ pass diff --git a/src/pardner/services/tumblr.py b/src/pardner/services/tumblr.py index 856f1b4..be07022 100644 --- a/src/pardner/services/tumblr.py +++ b/src/pardner/services/tumblr.py @@ -59,11 +59,11 @@ def fetch_feed_posts( obtained using the Tumblr API. :param count: number of posts to request. - :param text_only: whether or not to request only text-based posts (`True`) or - not (`False). + :param text_only: whether or not to request only text-based posts (``True``) or + not (``False``). :param request_params: any other endpoint-specific parameters to be sent to the endpoint. Depending on the parameters passed, this could override - `count` and `text_only`. + ``count`` and ``text_only``. :returns: a list of dictionary objects with information for the posts in a feed. diff --git a/src/pardner/services/utils.py b/src/pardner/services/utils.py index 3519ee4..ffaa079 100644 --- a/src/pardner/services/utils.py +++ b/src/pardner/services/utils.py @@ -6,10 +6,12 @@ def scope_as_string(scopes: Any, delimiter: str = ' ') -> str | None: Converts a sequence of individual scopes into a single scope string. :param scopes: a sequence of scopes as strings or a scope string. - :param delimiter: the string used to separate individual scopes. Defaults to single space. + :param delimiter: the string used to separate individual scopes. Defaults to single + space. :returns: a string containing all scopes. - :raises :class:ValueError: if `scopes` is neither a string nor a sequence of strings + :raises :class:ValueError: if ``scopes`` is neither a string nor a sequence of + strings. """ if isinstance(scopes, str) or scopes is None: return scopes @@ -23,7 +25,8 @@ def scope_as_set(scope: Any, delimiter: str = ' ') -> set[str]: Splits a scope with potentially more than one scope into a set of scopes. :param scope: a string with one or more scopes. - :param delimiter: the string used to separate individual scopes. Defaults to single space. + :param delimiter: the string used to separate individual scopes. Defaults to + single space. :returns: a set of scopes. """