jenkins-bot has submitted this change and it was merged.
Change subject: Fix ImagePage.getFileVersionHistoryTable ......................................................................
Fix ImagePage.getFileVersionHistoryTable
Use the correct data types. getFileVersionHistory returns a list of dict.
Bug: 55158
Change-Id: I565860785306adeae6c94b61cc22b892682ae53f --- M pywikibot/page.py 1 file changed, 6 insertions(+), 4 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index e69625d..2232a49 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -1859,15 +1859,17 @@ username, resolution, filesize, comment).
""" - # TODO; return value may need to change return self.site.loadimageinfo(self, history=True)
def getFileVersionHistoryTable(self): """Return the version history in the form of a wiki table.""" lines = [] - # TODO: if getFileVersionHistory changes, make sure this follows it - for (datetime, username, resolution, size, comment) \ - in self.getFileVersionHistory(): + for info in self.getFileVersionHistory(): + datetime = info['timestamp'] + username = info['user'] + resolution = '%dx%d' % (info['height'], info['width']) + size = info['size'] + comment = info['comment'] lines.append(u'| %s || %s || %s || %s || <nowiki>%s</nowiki>' % (datetime, username, resolution, size, comment)) return u'{| border="1"\n! date/time || username || resolution || size || edit summary\n|----\n' + \
pywikibot-commits@lists.wikimedia.org