Base class for listeners, ie. callables subscribed to pubsub.
wx.lib.pubsub.core.listenerimpl.Listener
Use callable_ as a listener of topicName. The argsInfo is the |
|
Get the listener that was given at initialization. Note that |
|
Return |
|
Get the module in which the callable was defined. |
|
Return a human readable name for listener, based on the |
|
Get a type name for the listener. This is a class name or |
|
True if this listener wants all message data: it has a **kwargs argument |
|
True if this listener wants topic object: it has a arg=pub.AUTO_TOPIC |
ListenerBase
¶Base class for listeners, ie. callables subscribed to pubsub.
__init__
(self, callable_, argsInfo, onDead=None)¶Use callable_ as a listener of topicName. The argsInfo is the return value from a Validator, ie an instance of callables.CallArgsInfo. If given, the onDead will be called with self as parameter, if/when callable_ gets garbage collected (callable_ is held only by weak reference).
getCallable
(self)¶Get the listener that was given at initialization. Note that this could be None if it has been garbage collected (e.g. if it was created as a wrapper of some other callable, and not stored locally).
isDead
(self)¶Return True
if this listener died (has been garbage collected)
module
(self)¶Get the module in which the callable was defined.
name
(self)¶Return a human readable name for listener, based on the listener’s type name and its id (as obtained from id(listener)). If caller just needs name based on type info, specify instance=False. Note that the listener’s id() was saved at construction time (since it may get garbage collected at any time) so the return value of name() is not necessarily unique if the callable has died (because id’s can be re-used after garbage collection).
typeName
(self)¶Get a type name for the listener. This is a class name or function name, as appropriate.
wantsTopicObjOnCall
(self)¶True if this listener wants topic object: it has a arg=pub.AUTO_TOPIC