Revision: 5586 Author: russblau Date: 2008-06-16 17:52:16 +0000 (Mon, 16 Jun 2008)
Log Message: ----------- Improvements to page saving and throttling
Modified Paths: -------------- branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py =================================================================== --- branches/rewrite/pywikibot/data/api.py 2008-06-16 17:51:26 UTC (rev 5585) +++ branches/rewrite/pywikibot/data/api.py 2008-06-16 17:52:16 UTC (rev 5586) @@ -164,11 +164,14 @@ params = urllib.urlencode(self.params) while True: # TODO catch http errors - self.site.throttle() # TODO: add write=True when needed + action = self.params.get("action", "") + write = action in ( + "edit", "move" + ) + self.site.throttle(write=write) uri = self.site.scriptpath() + "/api.php" try: - if self.params.get("action", "") in ( - "login", "edit", "move"): + if write or action == "login": # add other actions that require POST requests above rawdata = http.request(self.site, uri, method="POST", headers={'Content-Type':