Process this event by sending it to all known handlers that are valid for this event type. :param handler: Parent handler to process this event :param type: Event type
(self, handler: Handler, type: Optional[EventType] = None)
| 145 | return None |
| 146 | |
| 147 | def dispatch(self, handler: Handler, type: Optional[EventType] = None) -> None: |
| 148 | """ |
| 149 | Process this event by sending it to all known handlers that |
| 150 | are valid for this event type. |
| 151 | |
| 152 | :param handler: Parent handler to process this event |
| 153 | :param type: Event type |
| 154 | """ |
| 155 | type = type or self._type |
| 156 | _dispatch(handler, type.method, self) |
| 157 | if hasattr(handler, "handlers"): |
| 158 | for h in handler.handlers: |
| 159 | self.dispatch(h, type) |
| 160 | |
| 161 | def __repr__(self) -> str: |
| 162 | return "%s(%r)" % (self._type, self.context) |
no test coverage detected