l.t.k.KarmaRecorder : class documentation

Part of lp.testing.karma View In Hierarchy

Known subclasses: lp.testing.karma.KarmaAssignedEventListener

Helper that records selected karma events.

Install with register (and don't forget to uninstall later with unregister).

A list of karma events is accumulated in the karma_events property.

Method __init__ Create a KarmaRecorder, but do not activate it yet.
Method filter Does karma match our filters?
Method record Overridable: record the assignment of karma.
Method receive Process a karma event.
Method register_listener Register listener. Must be `unregister`ed later.
Method unregister_listener Unregister listener after register.
Method _filterFor Does an event property value pass our filter for that property?
def __init__(self, person=None, action_name=None, product=None, distribution=None, sourcepackagename=None):
Create a KarmaRecorder, but do not activate it yet.
ParameterspersonIf given, record only karma for this Person.
action_nameIf given, record only karma with this action name (e.g. questionasked, sponsoruploadaccepted, bugfixed).
productIf given, record only karma related to this Product.
distributionIf given, record only karma related to this Distribution.
sourcepackagenameIf given, record only karma related to this SourcePackageName.
def _filterFor(self, filter_value, event_value):
Does an event property value pass our filter for that property?
def filter(self, karma):
Does karma match our filters?
def record(self, karma):
Overridable: record the assignment of karma.

The default action to record the karma object in self.karma_events, but feel free to override this with your own handler.

def receive(self, obj, event):
Process a karma event.

Runs `filter` on the event and if it passes, `record`s it.
def register_listener(self):
Register listener.  Must be `unregister`ed later.
def unregister_listener(self):
Unregister listener after register.
API Documentation for Launchpad, generated by pydoctor at 2018-10-23 00:00:11.