# Path: mapmyfitness/exceptions.py
# class PageNotAnInteger(InvalidPage):
#     pass
# 
# class EmptyPage(InvalidPage):
#     pass


import collections
import copy
from math import ceil
from mapmyfitness.exceptions import PageNotAnInteger, EmptyPage



class Paginator(object):
    def __init__(self, initial_object_list, per_page, total_count,
                 searchable, original_kwargs, orphans=0):
        self.initial_object_list = initial_object_list
        self.per_page = per_page
        self.total_count = total_count
        self.searchable = searchable
        self.original_kwargs = original_kwargs
        self.orphans = int(orphans)
        self._num_pages = None

    def validate_number(self, 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')
        if number > self.num_pages:

# Path: mapmyfitness/exceptions.py
# class PageNotAnInteger(InvalidPage):
#     pass
# 
# class EmptyPage(InvalidPage):
#     pass


# Path: mapmyfitness/paginator.py
import collections
import copy
from math import ceil
from mapmyfitness.exceptions import PageNotAnInteger, EmptyPage




class Paginator(object):
    def __init__(self, initial_object_list, per_page, total_count,
                 searchable, original_kwargs, orphans=0):
        self.initial_object_list = initial_object_list
        self.per_page = per_page
        self.total_count = total_count
        self.searchable = searchable
        self.original_kwargs = original_kwargs
        self.orphans = int(orphans)
        self._num_pages = None

    def validate_number(self, 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')
        if number > self.num_pages:

            raise EmptyPage('That page contains no results')