ci/utils.py
def validate_page_number(number):
    """Validate the given 1-based page number."""
    try:
        number = int(number)
    except (TypeError, ValueError):
        raise PageNotAnInteger('That page number is not an integer')
    if number < 1:
        raise EmptyPage('That page number is less than 1')
    return number
def validate_page_number(number):
    try:
        number = int(number)
    except (TypeError, ValueError):
        raise PageNotAnInteger('That page number is not an integer')
    if number < 1:
        raise EmptyPage('That page number is less than 1')
    return number
def validate_page_number ( number ) : try : number = int ( number ) except ( TypeError , ValueError ) : raise PageNotAnInteger ( 'That page number is not an integer' ) if number < 1 : raise EmptyPage ( 'That page number is less than 1' ) return number
Validate the given 1-based page number.
Validate the given 1 - based page number .