def __call__(self, environ, start_response): app_name = peek_path_info(environ) if app_name in self._apps: pop_path_info(environ) return self._apps[app_name](environ, start_response) else: #resp = Response('404 Not Found', # status=404, content_type='text/plain') resp = NotFound() return resp(environ, start_response)
def __call__(self, environ, start_response): if peek_path_info(environ) == 'static': return self._static_app(environ, start_response) context = Context(self, environ, self._odb, self._jinja_env) try: endpoint, values = context.url_adapter.match() handler = getattr(views, endpoint) response = handler(context, **values) except HTTPException, e: response = e