MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / mountpoint_wrapper

Method mountpoint_wrapper

21-async/mojifinder/bottle.py:675–693  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

673 path_depth = len(segments)
674
675 def mountpoint_wrapper():
676 try:
677 request.path_shift(path_depth)
678 rs = HTTPResponse([])
679 def start_response(status, headerlist, exc_info=None):
680 if exc_info:
681 try:
682 _raise(*exc_info)
683 finally:
684 exc_info = None
685 rs.status = status
686 for name, value in headerlist: rs.add_header(name, value)
687 return rs.body.append
688 body = app(request.environ, start_response)
689 if body and rs.body: body = itertools.chain(rs.body, body)
690 rs.body = body or rs.body
691 return rs
692 finally:
693 request.path_shift(-path_depth)
694
695 options.setdefault('skip', True)
696 options.setdefault('method', 'PROXY')

Callers

nothing calls this directly

Calls 2

HTTPResponseClass · 0.85
path_shiftMethod · 0.80

Tested by

no test coverage detected