Revision: 5431 Author: nicdumz Date: 2008-05-22 19:51:27 +0000 (Thu, 22 May 2008)
Log Message: ----------- oops, regex fix ;)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-05-22 19:46:57 UTC (rev 5430) +++ trunk/pywikipedia/wikipedia.py 2008-05-22 19:51:27 UTC (rev 5431) @@ -2584,7 +2584,7 @@ result = [] history = re.search('(?s)<table class="filehistory">.+?</table>', self.getImagePageHtml()) if history: - lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td.*?><a href=".+?">(?P<datetime>.+?)</a></td><td>(?P<resolution>.*?)<span.*?>((?P<filesize>.+?)) </span></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>.*?<span class="comment">((?P<comment>.*?))</span></td></tr>') + lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td.*?><a href=".+?">(?P<datetime>.+?)</a></td><td>(?P<resolution>.*?) <span.*?>((?P<filesize>.+?))</span></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>.*?<span class="comment">((?P<comment>.*?))</span></td></tr>') if not lineR.search(history.group()): # b/c code lineR = re.compile(r'<tr>(?:<td>.*?</td>){1,2}<td><a href=".+?">(?P<datetime>.+?)</a></td><td><a href=".+?"(?: class="new"|) title=".+?">(?P<username>.+?)</a>.*?</td><td>(?P<resolution>.*?)</td><td class=".+?">(?P<filesize>.+?)</td><td>(?P<comment>.*?)</td></tr>')