MCPcopy
hub / github.com/benoitc/gunicorn / app

Function app

examples/readline_app.py:22–43  ·  view source on GitHub ↗

Simplest possible application object

(environ, start_response)

Source from the content-addressed store, hash-verified

20
21
22def app(environ, start_response):
23 """Simplest possible application object"""
24 status = '200 OK'
25
26 response_headers = [
27 ('Content-type', 'text/plain'),
28 ('Transfer-Encoding', "chunked"),
29 ('X-Gunicorn-Version', __version__)
30 ]
31 start_response(status, response_headers)
32
33 body = environ['wsgi.input']
34
35 lines = []
36 while True:
37 line = body.readline()
38 if line == b"":
39 break
40 print(line)
41 lines.append(line)
42
43 return iter(lines)

Callers

nothing calls this directly

Calls 1

readlineMethod · 0.45

Tested by

no test coverage detected