MCPcopy Index your code
hub / github.com/plotly/dash / QuartResponseAdapter

Class QuartResponseAdapter

dash/backends/_quart.py:64–89  ·  view source on GitHub ↗

A custom Response class that wraps Quart's Response and provides a set_response() method for compatibility with Dash's callback system.

Source from the content-addressed store, hash-verified

62
63
64class QuartResponseAdapter(ResponseAdapter):
65 """
66 A custom Response class that wraps Quart's Response
67 and provides a set_response() method for compatibility with Dash's callback system.
68 """
69
70 def __init__(self):
71 self._quart_response = Response(content_type="application/json")
72 super().__init__()
73
74 @property
75 def callback_response(self) -> Response:
76 return self._quart_response
77
78 def set_cookie(self, key, value="", **kwargs):
79 self._quart_response.set_cookie(key, value, **kwargs)
80
81 def append_header(self, key, value):
82 self._quart_response.headers.add(key, value)
83
84 def set_header(self, key, value):
85 self._quart_response.headers.set(key, value)
86
87 def set_response(self, **kwargs):
88 self._quart_response.set_data(kwargs.get("data", ""))
89 return self._quart_response
90
91
92class QuartDashServer(BaseDashServer[Quart]):

Callers 1

websocket_handlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…