jenkins-bot has submitted this change and it was merged.
Change subject: Get rid of throttle.verbosedelay ......................................................................
Get rid of throttle.verbosedelay
The delay verbosity can be enabled via config.noisysleep. verbosedelay was always set to false anyway with little chance it got used for anything but debugging.
Change-Id: I4cededcd0056f89f6a5d2a31524d06e90fcc7092 --- M pywikibot/site.py M pywikibot/throttle.py 2 files changed, 6 insertions(+), 11 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved Legoktm: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 578febf..bb098d3 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -157,8 +157,8 @@ """Return this Site's throttle. Initialize a new one if needed."""
if not hasattr(self, "_throttle"): - self._throttle = Throttle(self, multiplydelay=True, - verbosedelay=False) + self._throttle = Throttle(self, multiplydelay=True) + return self._throttle
@property diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py index 1d8da7a..1fb6669 100644 --- a/pywikibot/throttle.py +++ b/pywikibot/throttle.py @@ -38,7 +38,7 @@
""" def __init__(self, site, mindelay=None, maxdelay=None, writedelay=None, - multiplydelay=True, verbosedelay=False): + multiplydelay=True): self.lock = threading.RLock() self.mysite = str(site) self.ctrlfilename = config.datafilepath('throttle.ctrl') @@ -67,7 +67,6 @@ self.lastwait = 0.0 self.delay = 0 self.checktime = 0 - self.verbosedelay = verbosedelay self.multiplydelay = multiplydelay if self.multiplydelay: self.checkMultiplicity() @@ -134,12 +133,8 @@ else: f.close() self.process_multiplicity = count - if self.verbosedelay: - pywikibot.output(u"Found %(count)s %(mysite)s processes " - u"running, including this one." % locals()) - else: - pywikibot.log(u"Found %(count)s %(mysite)s processes " - u"running, including this one." % locals()) + pywikibot.log(u"Found %(count)s %(mysite)s processes " + u"running, including this one." % locals()) finally: self.lock.release()
@@ -254,7 +249,7 @@ self.next_multiplicity = math.log(1 + requestsize) / math.log(2.0) # Announce the delay if it exceeds a preset limit if wait > 0: - if wait > config.noisysleep or self.verbosedelay: + if wait > config.noisysleep: pywikibot.output( u"Sleeping for %(wait).1f seconds, %(now)s" % {'wait': wait,
pywikibot-commits@lists.wikimedia.org