Revision: 5529 Author: cosoleto Date: 2008-06-08 15:06:43 +0000 (Sun, 08 Jun 2008)
Log Message: ----------- RE in shortpages() was only good for English wiki sites.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-06-08 14:13:55 UTC (rev 5528) +++ trunk/pywikipedia/wikipedia.py 2008-06-08 15:06:43 UTC (rev 5529) @@ -4696,7 +4696,8 @@ path = self.shortpages_address(n = number) get_throttle() html = self.getUrl(path) - entryR = re.compile(ur'<li>(<a href=".+?" title=".+?">hist</a>) .<a href=".+?" title="(?P<title>.+?)">.+?</a> .[(?P<length>\d+)(.+?)]</li>', re.UNICODE) + entryR = re.compile(ur'<li>(<a href=".+?" title=".+?">.+?</a>) .<a href=".+?" title="(?P<title>.+?)">.+?</a> .[(?P<length>[\d.,]+).*?]</li>', re.UNICODE) + for m in entryR.finditer(html): title = m.group('title') length = int(m.group('length'))
pywikipedia-l@lists.wikimedia.org