Set an attribute `attr` on the WebSocket to the given `value`. Event handler attributes (`onopen`, `onmessage`, etc.) are specially handled to create proper proxies. Other attributes are set on the underlying WebSocket directly.
(self, attr, value)
| 231 | return getattr(self._js_websocket, attr) |
| 232 | |
| 233 | def __setattr__(self, attr, value): |
| 234 | """ |
| 235 | Set an attribute `attr` on the WebSocket to the given `value`. |
| 236 | |
| 237 | Event handler attributes (`onopen`, `onmessage`, etc.) are specially |
| 238 | handled to create proper proxies. Other attributes are set on the |
| 239 | underlying WebSocket directly. |
| 240 | """ |
| 241 | if attr in ["onclose", "onerror", "onmessage", "onopen"]: |
| 242 | _attach_event_handler(self._js_websocket, attr, value) |
| 243 | else: |
| 244 | setattr(self._js_websocket, attr, value) |
| 245 | |
| 246 | def send(self, data): |
| 247 | """ |
no test coverage detected