Expose r/o listener callback + details filter callback

Also makes sure that the kwargs that are returned are
not mutable by returning a copy (which if modified will
have no effect).

Change-Id: I1d04e2084cbf93d876e946b2bd6466a4b700faad
This commit is contained in:
Joshua Harlow
2015-04-12 22:55:24 -07:00
parent 15d73cb6d6
commit 661f3b0f41

View File

@@ -55,10 +55,20 @@ class Listener(object):
else:
self._kwargs = kwargs.copy()
@property
def callback(self):
"""Callback (can not be none) to call with event + details."""
return self._callback
@property
def details_filter(self):
"""Callback (may be none) to call to discard events + details."""
return self._details_filter
@property
def kwargs(self):
"""Dictionary of keyword arguments to use in future calls."""
return self._kwargs
return self._kwargs.copy()
@property
def args(self):