Revision: 6394
Author:   nicdumz
Date:     2009-02-21 02:06:58 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
getVersionHistory() was broken for pages with parenthesis in their title on MW 
> 15. Fixing the regex.

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py      2009-02-20 23:16:53 UTC (rev 6393)
+++ trunk/pywikipedia/wikipedia.py      2009-02-21 02:06:58 UTC (rev 6394)
@@ -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[^>]*>\([^\)]*\) \([^\)]*\) <[^>]*><[^>]*> 
<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[^>]*>\(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)
 
         startFromPage = None
         thisHistoryDone = False



_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to