.. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT whiteprints.cli.exception ========================= .. py:module:: whiteprints.cli.exception .. autoapi-nested-parse:: Command-Line Interface user defined exceptions. Exceptions ---------- .. autoapisummary:: whiteprints.cli.exception.InvalidAppNameError Functions --------- .. autoapisummary:: whiteprints.cli.exception.is_valid_slug whiteprints.cli.exception.check_app_name Module Contents --------------- .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:exception:: InvalidAppNameError(app_name: str) Bases: :py:obj:`ValueError` The application name is invalid. .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:function:: is_valid_slug(slug: str) -> bool Check if a slug is valid. :param slug: The slug candidate name. .. rubric:: Example >>> is_valid_slug("whiteprints") True >>> is_valid_slug("-bad slug") False :returns: True if the slug name is valid, False otherwise. .. SPDX-FileCopyrightText: © 2015 Read the Docs, Inc .. SPDX-FileCopyrightText: © 2024 The "Whiteprints" contributors .. .. SPDX-License-Identifier: MIT .. py:function:: check_app_name(app_name: str) -> str Check whether an app name is a valid slug. This function is the identity if the app name is a valid slug. :param app_name: The app name. .. rubric:: Example >>> check_app_name("valid-app-name") 'valid-app-name' :raises InvalidAppNameError: The app name is not a valid slug. :returns: The app name.