Revision: 5167 Author: btongminh Date: 2008-03-28 18:02:32 +0000 (Fri, 28 Mar 2008)
Log Message: ----------- Drop support for < 1.11, causes more trouble than it's worth
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/checkusage.py
Modified: trunk/pywikipedia/commonsdelinker/checkusage.py =================================================================== --- trunk/pywikipedia/commonsdelinker/checkusage.py 2008-03-25 15:14:48 UTC (rev 5166) +++ trunk/pywikipedia/commonsdelinker/checkusage.py 2008-03-28 18:02:32 UTC (rev 5167) @@ -334,32 +334,22 @@ if type(site) is str: hostname = site apipath = '/w/api.php' - live_version = (1, 11) else: hostname = site.hostname() apipath = site.apipath() - live_version = site.live_version()[:2] # FIXME: Use continue kwargs = {'action': 'query', 'titles': u'Image:' + image, 'prop': 'info'} - if live_version > (1, 10): - kwargs['list'] = 'imageusage' - kwargs['iulimit'] = '500' - else: - kwargs['list'] = 'imagelinks' - kwargs['illimit'] = '500' + kwargs['list'] = 'imageusage' + kwargs['iulimit'] = '500' res = self.http.query_api(hostname, apipath, **kwargs) if '-1' not in res['query']['pages'] and shared: return - if live_version > (1, 10): - usages = res['query'].get('imageusage', ()) - else: - usages = res['query'].get('imagelinks', {}).itervalues() - + usages = res['query'].get('imageusage', ()) for usage in usages: title = usage['title'].replace(' ', '_')
pywikipedia-l@lists.wikimedia.org