# Path: pyroutes/settings.py
# BUILTIN_TEMPLATES_DIR = os.path.join(
#     os.path.dirname(__file__),
#     'default_templates'
# )
# BUILTIN_BASE_TEMPLATE = 'base.xml'
# DEBUG = False
# DEFAULT_CONTENT_TYPE = 'text/html; charset=utf-8'
# SECRET_KEY = None
# TEMPLATE_DIR = None # /foo/bar/templates/
# MIDDLEWARE = (
#     'pyroutes.middleware.errors.NotFoundMiddleware',
#     #'pyroutes.middleware.appendslash.AppendSlashes',
#     'pyroutes.middleware.responsify.Responsify',
#     'pyroutes.middleware.errors.ErrorHandlerMiddleware',
# )


import hmac
    import sha as sha1
    from hashlib import sha1
from pyroutes import settings
            if expires:
                cookie_hash += '; expires=%s' % expires

            if path:
                cookie_hash += '; path=' + path

            self.cookie_headers.append(('Set-Cookie', cookie_hash))

    def add_unsigned_cookie(self, *args, **kwargs):
        "Helper functions for fast-pathing adding an unsigned cookie"
        self.add_cookie(sign=False, *args, **kwargs)

    def del_cookie(self, key):
        "Remove a previously added cookie"

        self.cookie_headers.append(
         ('Set-Cookie', "%s=null; expires=Thu, 01-Jan-1970 00:00:01 GMT" % key))
        self.cookie_headers.append(
         ('Set-Cookie', "%s_hash=null; expires=Thu, 01-Jan-1970 00:00:01 GMT"
            % key))

class CookieHashMissing(LookupError):
    "Exception raised if a signed cookie is missing it signature pair."
    pass

class CookieHashInvalid(ValueError):
    """Exception raised if a signature is invalid. Can be caused by either
    corrupt cookie, or the user tampering."""
    pass


# Path: pyroutes/settings.py
# BUILTIN_TEMPLATES_DIR = os.path.join(
#     os.path.dirname(__file__),
#     'default_templates'
# )
# BUILTIN_BASE_TEMPLATE = 'base.xml'
# DEBUG = False
# DEFAULT_CONTENT_TYPE = 'text/html; charset=utf-8'
# SECRET_KEY = None
# TEMPLATE_DIR = None # /foo/bar/templates/
# MIDDLEWARE = (
#     'pyroutes.middleware.errors.NotFoundMiddleware',
#     #'pyroutes.middleware.appendslash.AppendSlashes',
#     'pyroutes.middleware.responsify.Responsify',
#     'pyroutes.middleware.errors.ErrorHandlerMiddleware',
# )


# Path: pyroutes/http/cookies.py
import hmac
    import sha as sha1
    from hashlib import sha1
from pyroutes import settings

            if expires:
                cookie_hash += '; expires=%s' % expires

            if path:
                cookie_hash += '; path=' + path

            self.cookie_headers.append(('Set-Cookie', cookie_hash))

    def add_unsigned_cookie(self, *args, **kwargs):
        "Helper functions for fast-pathing adding an unsigned cookie"
        self.add_cookie(sign=False, *args, **kwargs)

    def del_cookie(self, key):
        "Remove a previously added cookie"

        self.cookie_headers.append(
         ('Set-Cookie', "%s=null; expires=Thu, 01-Jan-1970 00:00:01 GMT" % key))
        self.cookie_headers.append(
         ('Set-Cookie', "%s_hash=null; expires=Thu, 01-Jan-1970 00:00:01 GMT"
            % key))

class CookieHashMissing(LookupError):
    "Exception raised if a signed cookie is missing it signature pair."
    pass

class CookieHashInvalid(ValueError):
    """Exception raised if a signature is invalid. Can be caused by either
    corrupt cookie, or the user tampering."""
    pass


class CookieKeyMissing(AttributeError):