http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11717
Revision: 11717 Author: drtrigon Date: 2013-07-07 09:39:57 +0000 (Sun, 07 Jul 2013) Log Message: ----------- improvement; skip 'get_throttle' and 'put_throttle' in 'simulate=True' mode for speed-up
Modified Paths: -------------- trunk/pywikipedia/pywikibot/throttle.py
Modified: trunk/pywikipedia/pywikibot/throttle.py =================================================================== --- trunk/pywikipedia/pywikibot/throttle.py 2013-07-06 21:15:48 UTC (rev 11716) +++ trunk/pywikipedia/pywikibot/throttle.py 2013-07-07 09:39:57 UTC (rev 11717) @@ -233,6 +233,11 @@ until the wait expires.
""" + if pywikibot.simulate: + pywikibot.output(u'\03{lightyellow}SIMULATION: %s_throttle skipped.\03{default}'%\ + {True: u'put', False: u'get'}[write]) + return + self.lock.acquire() try: wait = self.waittime(write=write or self.write)
pywikipedia-svn@lists.wikimedia.org