Revision: 6396 Author: nicdumz Date: 2009-02-21 04:48:24 +0000 (Sat, 21 Feb 2009)
Log Message: ----------- getVersionHistory : the (cur) / (prev) texts in the history are localized. Making the regex more generic so it doesn't rely on locale
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-02-21 02:59:41 UTC (rev 6395) +++ trunk/pywikipedia/wikipedia.py 2009-02-21 04:48:24 UTC (rev 6396) @@ -2026,7 +2026,7 @@ elif self.site().versionnumber() < 15: editR = re.compile('<li>(.*?)\s+(.*).*?<a href=".*?oldid=([0-9]*)" title=".*?">([^<]*)</a> (?:<span class='history-user'>|)<a href=".*?" title=".*?">([^<]*?)</a>.*?(?:</span>|).*?(?:<span class=['"]comment['"]>(.*?)</span>)?</li>') else: - editR = re.compile(r'<li[^>]*>((?:cur|<a[^<]*</a>)) ((?:prev|<a[^<]*</a>)) <[^>]*><[^>]*> <a href="[^>'"]*oldid=(\d*)"[^>]*>([^<]*)</a> <span class=['"]history-user['"]><a [^>]*>([^<]*)</a>(?:[^<]|<(?!span class="comment">)(?!/li>))*(?:<span class="comment">((.*))</span>)?.*</li>', re.UNICODE) + editR = re.compile(r'<li[^>]*>((?:\w*|<a[^<]*</a>)) ((?:\w*|<a[^<]*</a>)) <[^>]*><[^>]*> <a href="[^>'"]*oldid=(\d*)"[^>]*>([^<]*)</a> <span class=['"]history-user['"]><a [^>]*>([^<]*)</a>(?:[^<]|<(?!span class="comment">)(?!/li>))*(?:<span class="comment">((.*))</span>)?.*</li>', re.UNICODE)
startFromPage = None thisHistoryDone = False