http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8987
Revision: 8987 Author: xqt Date: 2011-02-20 11:22:25 +0000 (Sun, 20 Feb 2011) Log Message: ----------- follow-up fix for r8985
Modified Paths: -------------- trunk/pywikipedia/botlist.py
Modified: trunk/pywikipedia/botlist.py =================================================================== --- trunk/pywikipedia/botlist.py 2011-02-20 11:18:33 UTC (rev 8986) +++ trunk/pywikipedia/botlist.py 2011-02-20 11:22:25 UTC (rev 8987) @@ -88,7 +88,7 @@ pywikibot.put_throttle() # It actually is a get, but a heavy one. m1 = True offset = '' - if site.versionnumber == 17: + if site.versionnumber >= 17: PATTERN = u'<li>(.*?) *((.*?),\s(.*?))(?:.*?)</li>' else: PATTERN = u'<li>(.*?) *((.*?),\s(.*?))</li>' @@ -97,7 +97,7 @@
m1 = re.findall(u'<li>.*?</li>', text) for item in m1: - m2 = re.search(PATTERN', item) + m2 = re.search(PATTERN, item) (bot, flag_local, flag_global) = m2.groups() flag_local = (flag_local[:2] == u'<a') flag_global = True # since group='Global_bot'
pywikipedia-svn@lists.wikimedia.org