Part of lp.testing.karma View In Hierarchy
No karma assignments will be printed until the register_listener() method is called.
Each time Karma is assigned to a Person, a line in the following format will be printed:
Karma added: action=<action>, [product|distribution]=<contextname>
If show_person is set to True, the name of the person to whom karma is granted will also be shown like this (on one line):
Karma added: action=<action>, [product|distribution]=<contextname>, person=<name>
A set of KarmaAction objects assigned since the register_listener() method was called is available in the added_listener_actions property.
| Method | __init__ | Create a KarmaRecorder, but do not activate it yet. |
| Method | record | Overridable: record the assignment of karma. |
Inherited from KarmaRecorder:
| Method | filter | Does karma match our filters? |
| 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? |
KarmaRecorder, but do not activate it yet.| Parameters | person | If given, record only karma for this Person. |
| action_name | If given, record only karma with this action name (e.g. questionasked, sponsoruploadaccepted, bugfixed). | |
| product | If given, record only karma related to this
Product. | |
| distribution | If given, record only karma related to this
Distribution. | |
| sourcepackagename | If given, record only karma related to
this SourcePackageName. |
The default action to record the karma object in
self.karma_events, but feel free to override this with your
own handler.