Revision: 8108 Author: alexsh Date: 2010-04-18 18:36:22 +0000 (Sun, 18 Apr 2010)
Log Message: ----------- Site().logpages(): add dump mode to return data only.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-04-18 18:26:23 UTC (rev 8107) +++ trunk/pywikipedia/wikipedia.py 2010-04-18 18:36:22 UTC (rev 8108) @@ -5686,7 +5686,7 @@ # TODO: avoid code duplication for the following methods
def logpages(self, number = 50, mode = '', title = None, user = None, repeat = False, - namespace = [], start = None, end = None, tag = None): + namespace = [], start = None, end = None, tag = None, dump = False):
if not self.has_api() or self.versionnumber() < 11 or \ mode not in ('block', 'protect', 'rights', 'delete', 'upload', @@ -5727,6 +5727,11 @@ for c in result['query']['logevents']: if (not namespace or c['ns'] in namespace) and \ not c.has_key('actionhidden'): + if dump: + # dump result only. + yield c + continue + if c['ns'] == 6: p_ret = ImagePage(self, c['title']) else:
pywikipedia-svn@lists.wikimedia.org