# 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 time
from pyroutes import settings
"""
A module containing a primitive timing middleware.
"""



class TimingMiddleware(object):
    """
    This middleware add a timing number at the bottom of the page if
    settings.DEBUG is True if the response content type is
    text/html or application/xhtml+xml

    Primitive profiling, but quite useful.
    """
    def __init__(self, passthrough, route):
        self.passthrough = passthrough

    def __call__(self, request):

# 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/middleware/timing.py
import time
from pyroutes import settings

"""
A module containing a primitive timing middleware.
"""



class TimingMiddleware(object):
    """
    This middleware add a timing number at the bottom of the page if
    settings.DEBUG is True if the response content type is
    text/html or application/xhtml+xml

    Primitive profiling, but quite useful.
    """
    def __init__(self, passthrough, route):
        self.passthrough = passthrough

    def __call__(self, request):

        if not settings.DEBUG: