http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9730
Revision: 9730 Author: russblau Date: 2011-11-07 18:40:40 +0000 (Mon, 07 Nov 2011) Log Message: ----------- Add toponly option to Site.recentchanges()
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2011-11-07 07:22:18 UTC (rev 9729) +++ branches/rewrite/pywikibot/site.py 2011-11-07 18:40:40 UTC (rev 9730) @@ -2015,14 +2015,13 @@ def recentchanges(self, start=None, end=None, reverse=False, namespaces=None, pagelist=None, changetype=None, showMinor=None, showBot=None, showAnon=None, - showRedirects=None, showPatrolled=None, step=None, - total=None): + showRedirects=None, showPatrolled=None, topOnly=False, + step=None, total=None): """Iterate recent changes.
@param start: Timestamp to start listing from @param end: Timestamp to end listing at @param reverse: if True, start with oldest changes (default: newest) - @param limit: iterate no more than this number of entries @param pagelist: iterate changes to pages in this list only @param pagelist: list of Pages @param changetype: only iterate changes of this type ("edit" for @@ -2038,6 +2037,8 @@ False (and not None), only list edits to non-redirect pages @param showPatrolled: if True, only list patrolled edits; if False (and not None), only list non-patrolled edits + @param topOnly: if True, only list changes that are the latest revision + (default False)
""" if start and end: @@ -2069,6 +2070,8 @@ for p in pagelist) if changetype: rcgen.request["rctype"] = changetype + if topOnly: + rcgen.request["rctoponly"] = "" filters = {'minor': showMinor, 'bot': showBot, 'anon': showAnon,