jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347233 )
Change subject: [bugfix] Re-enable getFileVersionHistoryTable() method ......................................................................
[bugfix] Re-enable getFileVersionHistoryTable() method
- getFileVersionHistoryTable always failed due to missing joined string for join statement - re-enable this method - use new translatable table header used by commons - use size inside dimension field
Bug: T162528 Change-Id: I96b9ebd72496cd73bd2710dce9599c85fc346c66 --- M pywikibot/page.py 1 file changed, 8 insertions(+), 9 deletions(-)
Approvals: XXN: Looks good to me, but someone else must approve Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 00c60c3..a5bf566 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2462,15 +2462,14 @@ """Return the version history in the form of a wiki table.""" lines = [] 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 ('{| border="1"\n! date/time || username || resolution || size ' - '|| edit summary\n|----\n\n|----\n'.join(lines) + '\n|}') + dimension = '{width}×{height} px ({size} bytes)'.format(**info) + lines.append('| {timestamp} || {user} || {dimension} |' + '| <nowiki>{comment}</nowiki>' + ''.format(dimension=dimension, **info)) + return ('{| class="wikitable"\n' + '! {{int:filehist-datetime}} || {{int:filehist-user}} |' + '| {{int:filehist-dimensions}} || {{int:filehist-comment}}\n' + '|-\n%s\n|}\n' % '\n|-\n'.join(lines))
@deprecated_args(step=None) def usingPages(self, total=None, content=False):
pywikibot-commits@lists.wikimedia.org