Support for more than 10 revisions in mediawiki.

Maximum number of revisions in iter_revisions is now 500, the API's limit
for normal users.

webcontentedit has been updated to use the 'count' option for do_log().
This commit is contained in:
Clément Schreiner 2011-02-16 23:19:50 +01:00
commit 6979604e6f
3 changed files with 9 additions and 7 deletions

View file

@ -138,13 +138,15 @@ class MediawikiBrowser(BaseBrowser):
data['lgtoken'] = result['login']['token']
result2 = self.API_post(data)
def iter_wiki_revisions(self, page):
'''Yield 'Revision' objects for the last 10 Revisions of the specified page.'''
def iter_wiki_revisions(self, page, nb_entries):
'''Yield 'Revision' objects for the last <nb_entries> revisions of the specified page.'''
if not self.is_logged():
self.login()
data = {'action': 'query',
'titles': page,
'prop': 'revisions',
'rvprop': 'ids|timestamp|comment|user|flags',
'rvlimit': '10',
'rvlimit': str(nb_entries),
}
result = self.API_get(data)