# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):


from shpkpr import exceptions
import slugify as libslugify
    .. code-block:: jinja

        {% for k, v in _all_env|filter_items("LABEL_", strip_prefix=True) %}
            "{{k}}": "{{v}}",
        {% endfor %}

    """
    if startswith is not None:
        value = [x for x in value.items() if x[0].startswith(startswith)]
    else:
        value = value.items()

    if startswith is not None and strip_prefix:
        value = [(x[0].replace(startswith, "", 1), x[1]) for x in value]

    return value


class IntegerRequired(exceptions.ShpkprException):
    exit_code = 2


class IntegerTooSmall(exceptions.ShpkprException):
    exit_code = 2


class IntegerTooLarge(exceptions.ShpkprException):
    exit_code = 2



# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):


# Path: shpkpr/template_filters.py
from shpkpr import exceptions
import slugify as libslugify

    .. code-block:: jinja

        {% for k, v in _all_env|filter_items("LABEL_", strip_prefix=True) %}
            "{{k}}": "{{v}}",
        {% endfor %}

    """
    if startswith is not None:
        value = [x for x in value.items() if x[0].startswith(startswith)]
    else:
        value = value.items()

    if startswith is not None and strip_prefix:
        value = [(x[0].replace(startswith, "", 1), x[1]) for x in value]

    return value


class IntegerRequired(exceptions.ShpkprException):
    exit_code = 2


class IntegerTooSmall(exceptions.ShpkprException):
    exit_code = 2


class IntegerTooLarge(exceptions.ShpkprException):
    exit_code = 2



@exceptions.rewrap(ValueError, IntegerRequired)