Revision: 6654 Author: nicdumz Date: 2009-04-22 01:46:25 +0000 (Wed, 22 Apr 2009)
Log Message: ----------- Using key in dict instead of dict.has_key(key)
Modified Paths: -------------- branches/rewrite/pywikibot/data/logentries.py branches/rewrite/scripts/category.py
Modified: branches/rewrite/pywikibot/data/logentries.py =================================================================== --- branches/rewrite/pywikibot/data/logentries.py 2009-04-22 01:42:00 UTC (rev 6653) +++ branches/rewrite/pywikibot/data/logentries.py 2009-04-22 01:46:25 UTC (rev 6654) @@ -177,8 +177,8 @@ Returns True if no redirect was created from the old title to the new title during the move """ - # Introduced in MW r47901, not yet live on WM sites. - return self.data['move'].has_key('suppressedredirect') + # Introduced in MW r47901 + return 'suppressedredirect' in self.data['move']
class ImportEntry(LogEntry):
Modified: branches/rewrite/scripts/category.py =================================================================== --- branches/rewrite/scripts/category.py 2009-04-22 01:42:00 UTC (rev 6653) +++ branches/rewrite/scripts/category.py 2009-04-22 01:46:25 UTC (rev 6654) @@ -252,7 +252,7 @@ server next time it's required. ''' # if we already know which subcategories exist here - if self.catContentDB.has_key(supercat): + if supercat in self.catContentDB: return self.catContentDB[supercat][0] else: subcatset = set(supercat.subcategories()) @@ -268,7 +268,7 @@ server next time it's required. ''' # if we already know which articles exist here - if self.catContentDB.has_key(cat): + if cat in self.catContentDB: return self.catContentDB[cat][1] else: subcatset = set(cat.subcategories()) @@ -279,7 +279,7 @@
def getSupercats(self, subcat): # if we already know which subcategories exist here - if self.superclassDB.has_key(subcat): + if subcat in self.superclassDB: return self.superclassDB[subcat] else: supercatset = set(subcat.categories())