Exception type additions
This commit is contained in:
parent
e1c42d9839
commit
f5567d2631
|
@ -7,6 +7,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class EventSystemPushException(Exception):
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
class EventSystem:
|
class EventSystem:
|
||||||
""" Inheret IPCServerMixin. Create an pub/sub systems. """
|
""" Inheret IPCServerMixin. Create an pub/sub systems. """
|
||||||
|
|
||||||
|
@ -37,14 +41,14 @@ class EventSystem:
|
||||||
self._gui_events.append(event)
|
self._gui_events.append(event)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
raise Exception("Invald event format! Please do: ['sender_id': str, method_target: method, (data,): any]")
|
raise EventSystemPushException("Invald event format! Please do: ['sender_id': str, method_target: method, (data,): any]")
|
||||||
|
|
||||||
def push_module_event(self, event: list) -> None:
|
def push_module_event(self, event: list) -> None:
|
||||||
if len(event) == 3:
|
if len(event) == 3:
|
||||||
self._module_events.append(event)
|
self._module_events.append(event)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
raise Exception("Invald event format! Please do: ['target_id': str, method_target: method, (data,): any]")
|
raise EventSystemPushException("Invald event format! Please do: ['target_id': str, method_target: method, (data,): any]")
|
||||||
|
|
||||||
def read_gui_event(self) -> list:
|
def read_gui_event(self) -> list:
|
||||||
return self._gui_events[0] if self._gui_events else None
|
return self._gui_events[0] if self._gui_events else None
|
||||||
|
|
Loading…
Reference in New Issue