Revision: 8126 Author: xqt Date: 2010-04-26 06:24:28 +0000 (Mon, 26 Apr 2010)
Log Message: ----------- re-enable redirect.py with the -moves and -api options (bugfix for #2991723)
Modified Paths: -------------- trunk/pywikipedia/redirect.py
Modified: trunk/pywikipedia/redirect.py =================================================================== --- trunk/pywikipedia/redirect.py 2010-04-23 14:35:54 UTC (rev 8125) +++ trunk/pywikipedia/redirect.py 2010-04-26 06:24:28 UTC (rev 8126) @@ -463,10 +463,13 @@ start = datetime.datetime.utcnow() \ - datetime.timedelta(0, self.offset*3600) offset_time = start.strftime("%Y%m%d%H%M%S") - wikipedia.output(u'Retrieving %d moved pages via API...' % len(allmoves)) + wikipedia.output(u'Retrieving %d moved pages via API...' + % self.api_number) if wikipedia.verbose: wikipedia.output(u"[%s]" % offset_time) - for moved_page,u,t,c in self.site.logpages(number = api_number, mode = 'move',start = offset_time): + for moved_page,u,t,c in self.site.logpages(number=self.api_number, + mode='move', + start=offset_time): try: if not moved_page.isRedirectPage(): continue @@ -475,7 +478,8 @@ except wikipedia.ServerError: continue try: - for page in moved_page.getReferences(follow_redirects=True, redirectsOnly=True): + for page in moved_page.getReferences(follow_redirects=True, + redirectsOnly=True): yield page except wikipedia.NoPage: # original title must have been deleted after move
pywikipedia-svn@lists.wikimedia.org