events: clarify docstrings about add_handler/remove_handler

https://github.com/QubesOS/qubes-core-admin/pull/100#discussion_r115745098
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-10 15:52:59 +02:00
parent cddc507788
commit bd1f84fcec
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -108,6 +108,8 @@ class Emitter(object, metaclass=EmitterMeta):
def add_handler(cls, event, func):
'''Add event handler to subject's class.
This is class method, it is invalid to call it on object instance.
:param str event: event identificator
:param collections.Callable handler: handler callable
'''
@ -119,6 +121,11 @@ class Emitter(object, metaclass=EmitterMeta):
def remove_handler(cls, event, func):
'''Remove event handler from subject's class.
This is class method, it is invalid to call it on object instance.
This method must be called on the same class as
:py:meth:`add_handler` was called to register the handler.
:param str event: event identificator
:param collections.Callable handler: handler callable
'''