Revision: 5154 Author: btongminh Date: 2008-03-23 14:45:18 +0000 (Sun, 23 Mar 2008)
Log Message: ----------- Extension of r5151: Fix a regression introduced in r5037: Fetching an edit token when we already had an edit token did not work, even when the edit token has changed.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-03-23 12:37:07 UTC (rev 5153) +++ trunk/pywikipedia/wikipedia.py 2008-03-23 14:45:18 UTC (rev 5154) @@ -4165,7 +4165,7 @@
return text
- def _getUserData(self, text, sysop = False): + def _getUserData(self, text, sysop = False, force = True): """ Get the user data from a wiki page data.
@@ -4181,7 +4181,7 @@
# Check for blocks - but only if version is 1.11 (userinfo is available) # and the user data was not yet loaded - if self.versionnumber() >= 11 and not self._userData[index]: + if self.versionnumber() >= 11 and (not self._userData[index] or force): blocked = self.isBlocked(sysop = sysop) if blocked and not self._isBlocked[index]: # Write a warning if not shown earlier @@ -4205,7 +4205,7 @@ self._messages[index] = False
# Don't perform other checks if the data was already loaded - if self._userData[index]: + if self._userData[index] and not force: return
# Search for the the user page link at the top. @@ -4363,7 +4363,7 @@ text = self.getUrl(url, sysop = sysop)
# Parse data - self._getUserData(text, sysop = sysop) + self._getUserData(text, sysop = sysop, force = force)
def search(self, query, number = 10, namespaces = None): """Yield search results (using Special:Search page) for query."""