add: webhook
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from events import PATH_UPDATED_EVENT, path_updated
|
||||
from events.WebhookEventHandlers import auto_instantiate
|
||||
from events.WebhookEventHandlers.PathWebhookEventHandlers import PathWebhookEventHandler
|
||||
from misc import Singleton
|
||||
|
||||
|
||||
@auto_instantiate
|
||||
class PathUpdatedWebhookEventHandler(PathWebhookEventHandler, Singleton):
|
||||
|
||||
_instance = None
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if cls._instance is None:
|
||||
cls._instance = super(PathUpdatedWebhookEventHandler, cls).__new__(cls)
|
||||
return cls._instance
|
||||
def __init__(self):
|
||||
if getattr(self, "_initialized", False):
|
||||
return
|
||||
super().__init__(PATH_UPDATED_EVENT)
|
||||
path_updated.connect(self)
|
||||
self._initialized = True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user