summaryrefslogtreecommitdiff
path: root/gerrit_stream.py
Commit message (Collapse)AuthorAgeFilesLines
* Reason is missing in ChangeRestoredEventDavid Pursehouse2012-07-241-0/+1
| | | | | | | The `change-restored` stream event can include a `reason` field, but this is not handled in the ChangeRestoredEvent class. Add it.
* `comment-added` event can have multiple approvalsDavid Pursehouse2012-07-241-16/+24
| | | | | | | | | | | The `comment-added` event can include multiple approvals, but the current implementation does not support this. Refactor it to allow multiple approvals to be handled. Also add the description field in the approval object. Refactor a bit to make the handling of supported approval categories easier to extend later if necessary.
* Add support for the `draft-published` eventDavid Pursehouse2012-07-241-0/+18
| | | | | Add a new class GerritDraftPublishedEvent and include it in the event handling.
* Fixing PEP-8 and pylint warningsDavid Pursehouse2012-07-241-8/+13
| | | | | | | Fix PEP-8 warnings found by the updated checker script. Fix pylint warnings. Constructors of derived classes should call the constructor of the base class.
* Python cleanup: inherit from objectErnst Sjostrand2012-07-241-7/+7
| | | | | Classes in Python should always inherit from object these days.
* Undefined variable in GerritCommentAddedEventDavid Pursehouse2012-07-241-32/+37
| | | | | | | | The GerritCommentAddedEvent constructor was referencing a variable that was not defined, thus causing NameError exception to be thrown. Also improved the error messages in the exceptions, and fixed some warnings reported by pylint.
* Check for callable event handler on attachDavid Pursehouse2012-07-241-1/+3
| | | | | When a listener is attached to the stream object, check that its "on_gerrit_event" is callable.
* Minor refactoring and adding initial unit testsDavid Pursehouse2012-07-241-46/+58
| | | | | | | | | Added constants for the event types and replaced debug prints with exceptions. Added initial unit tests covering the attach and detach methods. Tidied up the docstrings a bit.
* Initial version of class for handling Gerrit stream eventsDavid Pursehouse2012-07-241-0/+281
Added a new class GerritStream which listens to the output of the gerrit stream-events command and generates events based on the JSON events in the stream.