Revision: 8500 Author: xqt Date: 2010-09-08 14:47:59 +0000 (Wed, 08 Sep 2010)
Log Message: ----------- rename category.isEmpty() to category.isEmptyCategory() which indicates a category has no related pages.
Modified Paths: -------------- trunk/pywikipedia/category.py trunk/pywikipedia/catlib.py
Modified: trunk/pywikipedia/category.py =================================================================== --- trunk/pywikipedia/category.py 2010-09-08 14:42:19 UTC (rev 8499) +++ trunk/pywikipedia/category.py 2010-09-08 14:47:59 UTC (rev 8500) @@ -1,3 +1,4 @@ +#!/usr/bin/python #!/usr/bin/python # -*- coding: utf-8 -*- """ @@ -580,7 +581,7 @@
# Delete the old category and its moved talk page if copied and self.deleteEmptySourceCat == True: - if self.oldCat.isEmpty(): + if self.oldCat.isEmptyCategory(): confirm = not self.batchMode self.oldCat.delete(reason, confirm, mark = True) if oldMovedTalk is not None: @@ -745,7 +746,7 @@ for subcategory in subcategories: catlib.change_category(subcategory, self.cat, None, comment = self.editSummary, inPlace = self.inPlace) # Deletes the category page - if self.cat.exists() and self.cat.isEmpty(): + if self.cat.exists() and self.cat.isEmptyCategory(): if self.useSummaryForDeletion and self.editSummary: reason = self.editSummary else:
Modified: trunk/pywikipedia/catlib.py =================================================================== --- trunk/pywikipedia/catlib.py 2010-09-08 14:42:19 UTC (rev 8499) +++ trunk/pywikipedia/catlib.py 2010-09-08 14:47:59 UTC (rev 8500) @@ -1,3 +1,4 @@ +#!/usr/bin/python #!/usr/bin/python # -*- coding: utf-8 -*- """ @@ -438,8 +439,8 @@ supercats.append(cat) return unique(supercats)
- def isEmpty(self): - # TODO: rename; naming conflict with Page.isEmpty + def isEmptyCategory(self): + """Return True if category has no members (including subcategories).""" for tag, title in self._parseCategory(): return False return True