From ffc6d5efdfed6d4c3aac7fded766e97904d74339 Mon Sep 17 00:00:00 2001 From: Scott Petersen Date: Thu, 12 Oct 2017 15:10:42 -0700 Subject: [PATCH] Added ability to clear the event handlers. --- alarmdecoder/event/event.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alarmdecoder/event/event.py b/alarmdecoder/event/event.py index 0086cbb..b8c09ba 100644 --- a/alarmdecoder/event/event.py +++ b/alarmdecoder/event/event.py @@ -65,6 +65,10 @@ class EventHandler(object): self._getfunctionlist().remove(func) return self + def clear(self): + del self._getfunctionlist()[:] + return self + def fire(self, *args, **kwargs): """Fire event and call all handler functions