Revision: 5855 Author: russblau Date: 2008-08-27 22:06:03 +0000 (Wed, 27 Aug 2008)
Log Message: ----------- bug fixes
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2008-08-27 21:32:58 UTC (rev 5854) +++ branches/rewrite/pywikibot/site.py 2008-08-27 22:06:03 UTC (rev 5855) @@ -525,7 +525,8 @@ """Load page info from api and save in page attributes""" title = page.title(withSection=False) query = api.PropertyGenerator("info", site=self, - titles=title.encode(self.encoding())) + titles=title.encode(self.encoding()), + inprop="protection") for pageitem in query: if pageitem['title'] != title: raise Error( @@ -572,7 +573,7 @@ if not hasattr(page, "_redir"): self.loadpageinfo(page) if not page._redir: - raise pywikibot.IsNotRedirectPage + raise pywikibot.IsNotRedirectPage(page.title()) title = page.title(withSection=False) query = api.Request(site=self, action="query", property="info", inprop="protection|talkid|subjectid", @@ -730,13 +731,14 @@ or "nonredirects" return eigen
- def pagereferences(self, page, followRedirects, filterRedirects, - withTemplateInclusion, onlyTemplateInclusion): + def pagereferences(self, page, followRedirects=False, filterRedirects=None, + withTemplateInclusion=True, onlyTemplateInclusion=False): """Convenience method combining pagebacklinks and page_embeddedin.""" + #TODO Warn about deprecated arguments if onlyTemplateInclusion: return self.page_embeddedin(page) if not withTemplateInclusion: - return self.pagebacklinks(page, follow_redirects) + return self.pagebacklinks(page, followRedirects) import itertools return itertools.chain(self.pagebacklinks( page, followRedirects, filterRedirects),