MCPcopy
hub / github.com/pallets/werkzeug / dispatch

Method dispatch

examples/couchy/application.py:29–44  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

27 URL.db = db
28
29 def dispatch(self, environ, start_response):
30 local.application = self
31 request = Request(environ)
32 local.url_adapter = adapter = url_map.bind_to_environ(environ)
33 try:
34 endpoint, values = adapter.match()
35 handler = getattr(views, endpoint)
36 response = handler(request, **values)
37 except NotFound:
38 response = views.not_found(request)
39 response.status_code = 404
40 except HTTPException as e:
41 response = e
42 return ClosingIterator(
43 response(environ, start_response), [local_manager.cleanup]
44 )
45
46 def __call__(self, environ, start_response):
47 return self.dispatch(environ, start_response)

Callers 2

__call__Method · 0.95
dispatchFunction · 0.45

Calls 4

RequestClass · 0.90
ClosingIteratorClass · 0.90
bind_to_environMethod · 0.80
matchMethod · 0.45

Tested by 1

dispatchFunction · 0.36