Revision: 5928 Author: russblau Date: 2008-10-02 21:23:59 +0000 (Thu, 02 Oct 2008)
Log Message: ----------- Provide for changing the write delay; don't know how this was overlooked before.
Modified Paths: -------------- branches/rewrite/pywikibot/throttle.py
Modified: branches/rewrite/pywikibot/throttle.py =================================================================== --- branches/rewrite/pywikibot/throttle.py 2008-10-02 02:37:56 UTC (rev 5927) +++ branches/rewrite/pywikibot/throttle.py 2008-10-02 21:23:59 UTC (rev 5928) @@ -115,17 +115,19 @@ finally: self.lock.release()
- def setDelays(self, delay=None, absolute=False): + def setDelays(self, delay=None, writedelay=None, absolute=False): """Set the nominal delays in seconds. Defaults to config values.""" self.lock.acquire() try: if delay is None: delay = self.mindelay + if writedelay is None: + writedelay = self.writedelay if absolute: self.maxdelay = delay self.mindelay = delay self.delay = delay - self.writedelay = min(max(self.mindelay, self.writedelay), + self.writedelay = min(max(self.mindelay, writedelay), self.maxdelay) # Start the delay count now, not at the next check self.last_read = self.last_write = time.time()