jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/372800 )
Change subject: [IMPR] provide a repr string for LogEntry objects ......................................................................
[IMPR] provide a repr string for LogEntry objects
Change-Id: I74191bcd9601491e22b4fb3c4c8d1c2a89732315 --- M pywikibot/logentries.py 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py index 26dd3cf..b0928f4 100644 --- a/pywikibot/logentries.py +++ b/pywikibot/logentries.py @@ -55,6 +55,11 @@ % (self._expectedType, self.type())) self.data._type = self.type()
+ def __repr__(self): + """Return a string representation of LogEntry object.""" + return '<{0}({1}, logid={2})>'.format(type(self).__name__, + self.site.sitename, self.logid()) + def __hash__(self): """Return the id as the hash.""" return self.logid()
pywikibot-commits@lists.wikimedia.org