handler
dev_tool.event.handler
__all__ = ['ConfigEventHandler', 'FileEventHandler', 'NotificationEventHandler', 'TaskEventHandler']
module-attribute
ConfigEventHandler
A handler class for configuration change events.
This class manages callbacks for configuration changes and executes them when corresponding events are received.
The constructor for the ConfigEventHandler class.
Initializes empty callback lists for each configuration event type.
Source code in dev_tool/event/handler/config.py
handle
A method that handles configuration change events.
Parameters:
-
event(Event) –The event object to handle.
Source code in dev_tool/event/handler/config.py
register_callback
A method that registers a callback for a configuration event.
Parameters:
-
event_type(AppEventType) –The event type to listen for.
-
callback(Callable[[], None]) –The callback function to execute.
Source code in dev_tool/event/handler/config.py
unregister_callback
A method that unregisters a callback for a configuration event.
Parameters:
-
event_type(AppEventType) –The event type to stop listening for.
-
callback(Callable[[], None]) –The callback function to remove.
Source code in dev_tool/event/handler/config.py
get_event_type
staticmethod
A method that returns the event types this handler processes.
Returns:
-
list[AppEventType]–A list of event types.
Source code in dev_tool/event/handler/config.py
FileEventHandler
A handler class for file system events.
This class manages callbacks for file changes and executes them when corresponding events are received.
The constructor for the FileEventHandler class.
Initializes empty callback dictionaries for file events.
Source code in dev_tool/event/handler/file.py
handle
A method that handles file system events.
Parameters:
-
event(Event) –The event object to handle.
Source code in dev_tool/event/handler/file.py
register_callback
A method that registers a callback for file changes.
Parameters:
-
path(Path) –The file path to watch.
-
callback(Callable[[Path], None]) –The callback function to execute.
Source code in dev_tool/event/handler/file.py
unregister_callback
A method that unregisters a callback for file changes.
Parameters:
-
path(Path) –The file path to stop watching.
-
callback(Callable[[Path], None] | None, default:None) –The specific callback to remove, or None to remove all.
Source code in dev_tool/event/handler/file.py
get_event_type
staticmethod
A method that returns the event types this handler processes.
Returns:
-
list[AppEventType]–A list of event types.
Source code in dev_tool/event/handler/file.py
NotificationEventHandler
A handler class for notification events.
This class processes notification events and delegates them to the notification service for display.
The constructor for the NotificationEventHandler class.
Parameters:
-
notification_service(NotificationService) –The notification service instance.
Source code in dev_tool/event/handler/notification.py
notification_service = notification_service
instance-attribute
handle
A method that handles notification events.
Parameters:
-
event(Event) –The event object to handle.
Source code in dev_tool/event/handler/notification.py
get_event_type
staticmethod
A method that returns the event types this handler processes.
Returns:
-
list[AppEventType]–A list of event types.
Source code in dev_tool/event/handler/notification.py
TaskEventHandler
A handler class for task lifecycle events.
This class manages watchers for task events and notifies them when task state changes occur.
The constructor for the TaskEventHandler class.
Initializes an empty set of watchers.
Source code in dev_tool/event/handler/task.py
handle
A method that handles task lifecycle events.
Parameters:
-
event(Event) –The event object to handle.
Source code in dev_tool/event/handler/task.py
register_watcher
A method that registers a watcher for task events.
Parameters:
-
watcher(Callable[[dict], None]) –The watcher function to register.
unregister_watcher
A method that unregisters a watcher for task events.
Parameters:
-
watcher(Callable[[dict], None]) –The watcher function to unregister.
get_event_type
staticmethod
A method that returns the event types this handler processes.
Returns:
-
list[AppEventType]–A list of event types.