Module to interface with Gerrit.
Bases: object
Helper class to format review messages that are sent to Gerrit.
Parameters: |
|
---|
Append the given data to the output.
Parameters: | data – If a list, it is formatted as a bullet list with each entry in the list being a separate bullet. Otherwise if it is a string, the string is added as a paragraph. |
---|---|
Raises : | ValueError if data is not a list or a string. |
Escape a string for use in Gerrit commands.
Parameters: | string (str) – The string to escape. |
---|---|
Returns: | The string with necessary escapes and surrounding double quotes so that it can be passed to any of the Gerrit commands that require double-quoted strings. |
Gerrit client interface.
Bases: object
Gerrit client interface.
Parameters: |
|
---|
Get connection information.
Returns : | A tuple of the username, and version of Gerrit that is connected to. |
---|
Get the Gerrit version.
Returns : | The version of Gerrit that is connected to, as a string. |
---|
Get the next event from the queue.
Parameters: |
|
---|---|
Returns : | The next event as a pygerrit.events.GerritEvent instance, or None if:
|
Create event from data and add it to the queue.
Parameters: | data (json) – The JSON data from which to create the event. |
---|---|
Raises : | pygerrit.error.GerritError if the queue is full, or the factory could not create the event. |
Run a query.
Parameters: | term (str) – The query term to run. |
---|---|
Returns : | A list of results as pygerrit.models.Change objects. |
Raises : | ValueError if term is not a string. |
Error classes.
Gerrit event classes.
Bases: pygerrit.events.GerritEvent
Gerrit “change-abandoned” event.
Bases: pygerrit.events.GerritEvent
Gerrit “change-merged” event.
Bases: pygerrit.events.GerritEvent
Gerrit “change-restored” event.
Bases: pygerrit.events.GerritEvent
Gerrit “comment-added” event.
Bases: pygerrit.events.GerritEvent
Gerrit “draft-published” event.
Bases: pygerrit.events.GerritEvent
Error occurred when processing json data from Gerrit’s event stream.
Bases: object
Gerrit event factory.
Bases: pygerrit.events.GerritEvent
Gerrit “merge-failed” event.
Bases: pygerrit.events.GerritEvent
Gerrit “patchset-created” event.
Bases: pygerrit.events.GerritEvent
Gerrit “ref-updated” event.
Bases: pygerrit.events.GerritEvent
Gerrit “reviewer-added” event.
Bases: pygerrit.events.GerritEvent
Gerrit “topic-changed” event.
Bases: pygerrit.events.GerritEvent
Unknown event type received in json data from Gerrit’s event stream.
Models for Gerrit JSON data.
Bases: object
Gerrit user account (name and email address).
Bases: object
Gerrit approval (verified, code review, etc).
Bases: pygerrit.models.Patchset
Gerrit current patch set.
Gerrit SSH Client.
Gerrit event stream interface.
Class to listen to the Gerrit event stream and dispatch events.