# Path: seth/classy/base.py
# class View(object):
#     dispatchable_methods = [
#         'GET', 'POST', 'PUT', 'DELETE', 'PATCH',
#         'CONNECT', 'TRACE', 'HEAD', 'OPTIONS'
#     ]
# 
#     def __init__(self, request):
#         self.request = request
# 
#     def perform_setup(self):
#         pass
# 
#     @property
#     def request_method(self):
#         return self.request.method
# 
#     def dispatch(self, **kwargs):
#         self.perform_setup()
# 
#         if self.request_method in self.dispatchable_methods:
# 
#             attr = self.request_method.lower()
#             response_data = getattr(self, attr)(**kwargs)
#             return response_data
# 
#         return self.not_allowed()
# 
#     def get(self, **kwargs):
#         return self.not_allowed()
# 
#     def post(self, **kwargs):
#         return self.not_allowed()
# 
#     def put(self, **kwargs):
#         return self.not_allowed()
# 
#     def delete(self, **kwargs):
#         return self.not_allowed()
# 
#     def patch(self, **kwargs):
#         return self.not_allowed()
# 
#     def head(self, **kwargs):
#         return self.not_allowed()
# 
#     def options(self, **kwargs):
#         return self.not_allowed()
# 
#     def trace(self, **kwargs):
#         return self.not_allowed()
# 
#     def connect(self, **kwargs):
#         return self.not_allowed()


from pyramid.httpexceptions import HTTPNotFound, HTTPMethodNotAllowed,\
    HTTPBadRequest, HTTPUnauthorized
from seth.classy.base import View

    def validate_version(self):
        if self.versioning_policy:
            policy = self.versioning_policy()
            fetched_version = policy.get_version_info(self.request)
            return policy.is_allowed(self.request, fetched_version)

        return True

    def get_view_name(self):
        return self.__class__.__name__

    def get_view_description(self):
        return u""

    def get_allowed_methods(self):
        return self.allowed_methods

    @property
    def default_response_headers(self):
        headers = [
            ('Allow', ', '.join(self.allowed_methods)),
        ]

        if self.display_version:
            headers.append(('API-Version', self.request.version))

        return headers

    def dispatch(self, **kwargs):

# Path: seth/classy/base.py
# class View(object):
#     dispatchable_methods = [
#         'GET', 'POST', 'PUT', 'DELETE', 'PATCH',
#         'CONNECT', 'TRACE', 'HEAD', 'OPTIONS'
#     ]
# 
#     def __init__(self, request):
#         self.request = request
# 
#     def perform_setup(self):
#         pass
# 
#     @property
#     def request_method(self):
#         return self.request.method
# 
#     def dispatch(self, **kwargs):
#         self.perform_setup()
# 
#         if self.request_method in self.dispatchable_methods:
# 
#             attr = self.request_method.lower()
#             response_data = getattr(self, attr)(**kwargs)
#             return response_data
# 
#         return self.not_allowed()
# 
#     def get(self, **kwargs):
#         return self.not_allowed()
# 
#     def post(self, **kwargs):
#         return self.not_allowed()
# 
#     def put(self, **kwargs):
#         return self.not_allowed()
# 
#     def delete(self, **kwargs):
#         return self.not_allowed()
# 
#     def patch(self, **kwargs):
#         return self.not_allowed()
# 
#     def head(self, **kwargs):
#         return self.not_allowed()
# 
#     def options(self, **kwargs):
#         return self.not_allowed()
# 
#     def trace(self, **kwargs):
#         return self.not_allowed()
# 
#     def connect(self, **kwargs):
#         return self.not_allowed()


# Path: seth/classy/rest/base.py
from pyramid.httpexceptions import HTTPNotFound, HTTPMethodNotAllowed,\
    HTTPBadRequest, HTTPUnauthorized
from seth.classy.base import View


    def validate_version(self):
        if self.versioning_policy:
            policy = self.versioning_policy()
            fetched_version = policy.get_version_info(self.request)
            return policy.is_allowed(self.request, fetched_version)

        return True

    def get_view_name(self):
        return self.__class__.__name__

    def get_view_description(self):
        return u""

    def get_allowed_methods(self):
        return self.allowed_methods

    @property
    def default_response_headers(self):
        headers = [
            ('Allow', ', '.join(self.allowed_methods)),
        ]

        if self.display_version:
            headers.append(('API-Version', self.request.version))

        return headers

    def dispatch(self, **kwargs):

        self.perform_setup()