MCPcopy Create free account
hub / github.com/datapane/datapane / start_response

Method start_response

python-client/src/datapane/_vendor/bottle.py:708–721  ·  view source on GitHub ↗
(status, headerlist, exc_info=None)

Source from the content-addressed store, hash-verified

706 rs = HTTPResponse([])
707
708 def start_response(status, headerlist, exc_info=None):
709 if exc_info:
710 _raise(*exc_info)
711 if py3k:
712 # Errors here mean that the mounted WSGI app did not
713 # follow PEP-3333 (which requires latin1) or used a
714 # pre-encoding other than utf8 :/
715 status = status.encode('latin1').decode('utf8')
716 headerlist = [(k, v.encode('latin1').decode('utf8'))
717 for (k, v) in headerlist]
718 rs.status = status
719 for name, value in headerlist:
720 rs.add_header(name, value)
721 return rs.body.append
722
723 body = app(request.environ, start_response)
724 rs.body = itertools.chain(rs.body, body) if rs.body else body

Callers

nothing calls this directly

Calls 3

_raiseFunction · 0.85
decodeMethod · 0.80
add_headerMethod · 0.80

Tested by

no test coverage detected