diff options
| author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-12 14:57:02 +0900 |
|---|---|---|
| committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-12 18:05:56 +0900 |
| commit | 6c345c62582769be8394d0a731461a7371aabff2 (patch) | |
| tree | 0d5e92409238a816880ef29b7f3b0a81aa09b52a /pygerrit | |
| parent | ffff3e87eb1c474bbe4846f4be55cb444f5b8eeb (diff) | |
| download | pygerrit-6c345c62582769be8394d0a731461a7371aabff2.tar.gz | |
Add missing __repr__ methods on ErrorEvent and UnhandledEvent
Also fix a minor coding style issue.
Change-Id: Ib366a816e5cf979eb94c7ce545d1c87c6c3984c8
Diffstat (limited to 'pygerrit')
| -rw-r--r-- | pygerrit/events.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pygerrit/events.py b/pygerrit/events.py index 649e7cb..9cf4d23 100644 --- a/pygerrit/events.py +++ b/pygerrit/events.py @@ -101,6 +101,9 @@ class UnhandledEvent(GerritEvent): def __init__(self, json_data): super(UnhandledEvent, self).__init__(json_data) + def __repr__(self): + return u"<UnhandledEvent>" + @GerritEventFactory.register("error-event") class ErrorEvent(GerritEvent): @@ -109,7 +112,7 @@ class ErrorEvent(GerritEvent): def __init__(self, json_data): super(ErrorEvent, self).__init__(json_data) - self.error= json_data["error"] + self.error = json_data["error"] @classmethod def error_json(cls, error): @@ -118,6 +121,9 @@ class ErrorEvent(GerritEvent): '"error":"%s"}' % str(error) return json.loads(data) + def __repr__(self): + return u"<ErrorEvent: %s>" % self.error + @GerritEventFactory.register("patchset-created") class PatchsetCreatedEvent(GerritEvent): |
