def str_to_int_validator(input_str):
    """
    A filter allowing any string which can be
    converted to an int.
    Raises ValidationError otherwise.
    """
    try:
        int(input_str)
        return input_str
    except ValueError:
        raise ValidationError(
            'Input here must be a number. (Ctrl-C to exit)\n'
        )

    A filter allowing any string which can be
    converted to an int.
    Raises ValidationError otherwise.
    
gcalcli/validators.py