mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Update package versions.
Do not use Path in schemas (causes issues with empty paths). Change how notifications are handled. Run tests with Python 3.9
This commit is contained in:
1 parent
bf19da1dc2
commit
acc5c7ebfa
26 files changed
+121
-134
No files matched your search
@@ -36,10 +36,13 @@ class NotificationManager:
|
||||
|
||||
Use it with Python with
|
||||
"""
|
||||
|
||||
queue = NotificationQueue()
|
||||
self._listeners.add(queue)
|
||||
yield queue
|
||||
self._listeners.remove(queue)
|
||||
try:
|
||||
yield queue
|
||||
finally:
|
||||
self._listeners.remove(queue)
|
||||
|
||||
def emit(self, action, event, **kwargs):
|
||||
"""
|
||||
@@ -49,6 +52,7 @@ class NotificationManager:
|
||||
:param event: Event to send
|
||||
:param kwargs: Add this meta to the notification (project_id for example)
|
||||
"""
|
||||
|
||||
for listener in self._listeners:
|
||||
listener.put_nowait((action, event, kwargs))
|
||||
|
||||
|
||||
Reference in new issue
Block a user