Revision: 5168 Author: btongminh Date: 2008-03-29 12:01:02 +0000 (Sat, 29 Mar 2008)
Log Message: ----------- imageusage returns a dict, not a list
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/checkusage.py
Modified: trunk/pywikipedia/commonsdelinker/checkusage.py =================================================================== --- trunk/pywikipedia/commonsdelinker/checkusage.py 2008-03-28 18:02:32 UTC (rev 5167) +++ trunk/pywikipedia/commonsdelinker/checkusage.py 2008-03-29 12:01:02 UTC (rev 5168) @@ -349,9 +349,9 @@ if '-1' not in res['query']['pages'] and shared: return - usages = res['query'].get('imageusage', ()) + usages = res['query'].get('imageusage', {}) - for usage in usages: + for usage in usages.itervalues(): title = usage['title'].replace(' ', '_') namespace = usage['ns'] if namespace != 0: