http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11352
Revision: 11352 Author: xqt Date: 2013-04-07 10:33:13 +0000 (Sun, 07 Apr 2013) Log Message: ----------- use new page method getMovedTarget()
Modified Paths: -------------- trunk/pywikipedia/fixing_redirects.py
Modified: trunk/pywikipedia/fixing_redirects.py =================================================================== --- trunk/pywikipedia/fixing_redirects.py 2013-04-07 10:31:07 UTC (rev 11351) +++ trunk/pywikipedia/fixing_redirects.py 2013-04-07 10:33:13 UTC (rev 11352) @@ -170,11 +170,9 @@ try: target = page2.getRedirectTarget() except pywikibot.NoPage: - gen = mysite.logpages(number=1, mode='move', title=page2.title(), - dump=True) try: - lastmove = gen.next()['move'] - except StopIteration: + target = page2.getMovedTarget() + except pywikibot.NoPage: continue target = pywikibot.Page(mysite, lastmove['new_title']) except (pywikibot.Error, pywikibot.SectionError):
pywikipedia-svn@lists.wikimedia.org