Remove a handler; drops the session subscription with the last one.
(self, callback_id: int)
| 485 | return callback_id |
| 486 | |
| 487 | def remove_handler(self, callback_id: int) -> None: |
| 488 | """Remove a handler; drops the session subscription with the last one.""" |
| 489 | conn = self._script._conn |
| 490 | conn.remove_callback(_EventRef(self.EVENT), callback_id) |
| 491 | with self._lock: |
| 492 | removed = self._categories.pop(callback_id, None) |
| 493 | if removed is not None and not self._categories: |
| 494 | _unsubscribe_from_event(conn, self.EVENT, self._subscription_id) |
| 495 | self._subscription_id = None |
| 496 | |
| 497 | def clear_handlers(self, category: str) -> None: |
| 498 | """Remove every handler registered under ``category``.""" |
no test coverage detected