Revision: 8650 Author: xqt Date: 2010-10-14 11:37:25 +0000 (Thu, 14 Oct 2010)
Log Message: ----------- Avoid error message if imagerepository is shared (on commons)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-10-14 07:30:15 UTC (rev 8649) +++ trunk/pywikipedia/wikipedia.py 2010-10-14 11:37:25 UTC (rev 8650) @@ -3628,16 +3628,13 @@ raise RuntimeError("%s" %data['error']) count = 0 pageInfo = data['query']['pages'].values()[0] + self._local = pageInfo["imagerepository"] != "shared" if data['query']['pages'].keys()[0] == "-1": - if 'missing' in pageInfo: + if 'missing' in pageInfo and self._local: raise NoPage(self.site(), self.aslink(forceInterwiki=True), "Page does not exist.") elif 'invalid' in pageInfo: raise BadTitle('BadTitle: %s' % self) - if pageInfo["imagerepository"] == "shared": - self._local = False - else: - self._local = True infos = []
try:
pywikipedia-svn@lists.wikimedia.org