Revision: 6705 Author: nicdumz Date: 2009-04-25 09:20:15 +0000 (Sat, 25 Apr 2009)
Log Message: ----------- Use dict.iteritems() when accessing dict values inside a loop
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2009-04-25 09:17:58 UTC (rev 6704) +++ trunk/pywikipedia/interwiki.py 2009-04-25 09:20:15 UTC (rev 6705) @@ -1694,10 +1694,10 @@ reader = warnfile.WarnfileReader(filename) # we won't use removeHints (hints, removeHints) = reader.getHints() - for page in hints: + for page, pagelist in hints.iteritems(): # The WarnfileReader gives us a list of pagelinks, but titletranslate.py expects a list of strings, so we convert it back. # TODO: This is a quite ugly hack, in the future we should maybe make titletranslate expect a list of pagelinks. - hintStrings = ['%s:%s' % (hintedPage.site().language(), hintedPage.title()) for hintedPage in hints[page]] + hintStrings = ['%s:%s' % (hintedPage.site().language(), hintedPage.title()) for hintedPage in pagelist] bot.add(page, hints = hintStrings)
#===========