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:
parent
d8cb5230ca
commit
6979604e6f
3 changed files with 9 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue