Revision: 6889 Author: russblau Date: 2009-05-15 21:30:29 +0000 (Fri, 15 May 2009)
Log Message: ----------- Fix imageusage bug and allow namespace filters in Category.members
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2009-05-15 16:58:23 UTC (rev 6888) +++ branches/rewrite/pywikibot/page.py 2009-05-15 21:30:29 UTC (rev 6889) @@ -1407,7 +1407,7 @@
def usingPages(self): """Yield Pages on which the image is displayed.""" - return self.site().getimageusage(self) + return self.site().imageusage(self)
class Category(Page): @@ -1499,15 +1499,15 @@ for article in subcat.articles(recurse): yield article
- def members(self, recurse=False): + def members(self, recurse=False, namespaces=None): """Yield all category contents (subcats, pages, and files).""" - for member in self.site().categorymembers(self): + for member in self.site().categorymembers(self, namespaces): yield member if recurse: if not isinstance(recurse, bool) and recurse: recurse = recurse - 1 for subcat in self.subcategories(): - for article in subcat.members(recurse): + for article in subcat.members(recurse, namespaces): yield article
def isEmptyCategory(self):