Revision: 4352
Author: cosoleto
Date: 2007-09-24 09:07:53 +0000 (Mon, 24 Sep 2007)
Log Message:
-----------
bug fix in newpages(), page length was not correctly reported
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-24 09:05:25 UTC (rev 4351)
+++ trunk/pywikipedia/wikipedia.py 2007-09-24 09:07:53 UTC (rev 4352)
@@ -3635,12 +3635,12 @@
get_throttle()
html = self.getUrl(path)
- entryR = re.compile('<li[^>]*>(?P<date>.+?) \S*?<a
href=".+?"
title="(?P<title>.+?)">.+?</a>.+?[\(\[](?P<length>\d+)[^\)\]]*[\)\]]
.?<a href=".+?" title=".+?:(?P<username>.+?)">')
+ entryR = re.compile('<li[^>]*>(?P<date>.+?) \S*?<a
href=".+?"
title="(?P<title>.+?)">.+?</a>.+?[\(\[](?P<length>[\d,.]+)[^\)\]]*[\)\]]
.?<a href=".+?" title=".+?:(?P<username>.+?)">')
for m in entryR.finditer(html):
date = m.group('date')
title = m.group('title')
title = title.replace('"', '"')
- length = int(m.group('length'))
+ length = int(re.sub("[,.]", "",
m.group('length')))
loggedIn = u''
username = m.group('username')
comment = u''
Show replies by date