From 399a4a53ee020352ebd18042239ee1aaaf9823df Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 23 May 2016 02:39:08 +0200 Subject: [PATCH] Check if any functions are subscribed to a callback event --- yaboli/callbacks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yaboli/callbacks.py b/yaboli/callbacks.py index 2dfbb25..04c36b8 100644 --- a/yaboli/callbacks.py +++ b/yaboli/callbacks.py @@ -51,3 +51,12 @@ class Callbacks(): kwargs = c_info["kwargs"] c(*args, **kwargs) + + def exists(self, event): + """ + exists(event) -> bool + + Are any functions subscribed to this event? + """ + + return event in self._callbacks