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

Method __call__

examples/webpylike/webpylike.py:43–58  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

41 self.views = views
42
43 def __call__(self, environ, start_response):
44 try:
45 req = Request(environ)
46 for regex, view in self.urls:
47 match = regex.match(req.path)
48 if match is not None:
49 view = self.views[view](self, req)
50 if req.method not in ("GET", "HEAD", "POST", "DELETE", "PUT"):
51 raise NotImplemented() # noqa: F901
52 resp = getattr(view, req.method)(*match.groups())
53 break
54 else:
55 raise NotFound()
56 except HTTPException as e:
57 resp = e
58 return resp(environ, start_response)

Callers

nothing calls this directly

Calls 4

RequestClass · 0.90
NotImplementedClass · 0.90
NotFoundClass · 0.90
matchMethod · 0.45

Tested by

no test coverage detected