listeners
oxytcmri.infrastructure.listeners
¶
This module provides listeners for monitoring events in the application.
Classes:
Name | Description |
---|---|
TqdmProgressListener |
A listener that displays a progress bar using tqdm for |
TqdmProgressListener()
¶
Bases: Listener
A listener that displays a progress bar using tqdm for ProgressEvent
events.
This class implements the Listener interface and updates a tqdm progress bar based on the events it receives. It initializes a progress bar when it receives the first ProgressEvent and updates it with the current step. When the total number of steps is reached, the progress bar is closed.
Attributes:
Name | Type | Description |
---|---|---|
progress_bar |
tqdm | None
|
The tqdm progress bar instance. It is initialized to None and created when the first ProgressEvent is received. |
Methods:
Name | Description |
---|---|
on_event |
Handle the event by updating the progress bar if the event is a |
Source code in oxytcmri/infrastructure/listeners.py
25 26 |
|
progress_bar = None
instance-attribute
¶
on_event(event)
¶
Handle the event by updating the progress bar if the event is a ProgressEvent
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Event
|
The event to handle. |
required |
Source code in oxytcmri/infrastructure/listeners.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|