Skip to content
Snippets Groups Projects
Commit 29db4a55 authored by Hendrik Buschmeier's avatar Hendrik Buschmeier
Browse files

ipaaca-python: warn if handler function is registered more than once.

parent 02185cb5
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,8 @@ class Buffer(object): ...@@ -155,6 +155,8 @@ class Buffer(object):
for_categories -- a list of category names or None if handler should for_categories -- a list of category names or None if handler should
be called for all categories be called for all categories
""" """
if handler_function in [h._handler_function for h in self._iu_event_handlers]:
LOGGER.warn("The handler function '" + handler_function.__name__ + '" has been registered before.')
handler = IUEventHandler(handler_function=handler_function, for_event_types=for_event_types, for_categories=for_categories) handler = IUEventHandler(handler_function=handler_function, for_event_types=for_event_types, for_categories=for_categories)
self._iu_event_handlers.append(handler) self._iu_event_handlers.append(handler)
return handler return handler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment