Revision: 6968 Author: russblau Date: 2009-06-17 11:22:20 +0000 (Wed, 17 Jun 2009)
Log Message: ----------- Fix bugs affecting page deletion
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2009-06-16 21:18:20 UTC (rev 6967) +++ branches/rewrite/pywikibot/site.py 2009-06-17 11:22:20 UTC (rev 6968) @@ -1115,7 +1115,8 @@ """ query = api.PropertyGenerator("info|revisions", titles=page.title(withSection=False), - intoken=tokentype) + intoken=tokentype, + site=self) for item in query: if item['title'] != page.title(withSection=False): raise Error( @@ -2452,7 +2453,8 @@ % e.__class__.__name__) if not self.logged_in(sysop=True): raise NoUsername("delete: Unable to login as sysop") - token = self.token("delete") + token = self.token(page, "delete") + self.lock_page(page) req = api.Request(site=self, action="delete", token=token, title=page.title(withSection=False), reason=summary)