jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55030) Add color to put_async waiting message ......................................................................
(bug 55030) Add color to put_async waiting message
The color names will be stripped by output layer I removed the double datetime import
Change-Id: I844a11467ff579eb830f16879c1f3d85211bebf5 --- M pywikibot/__init__.py 1 file changed, 6 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index d0d08cf..c7f870b 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -503,7 +503,6 @@ pywikibot.debug(u"stopme() called", _logger)
def remaining(): - import datetime remainingPages = page_put_queue.qsize() - 1 # -1 because we added a None element to stop the queue remainingSeconds = datetime.timedelta( @@ -514,8 +513,12 @@ stopped = True
if page_put_queue.qsize() > 1: - output(u'Waiting for %i pages to be put. Estimated time remaining: %s' - % remaining()) + num, sec = remaining() + format_values = dict(num=num, sec=sec) + output(u'\03{lightblue}' + u'Waiting for %(num)i pages to be put. ' + u'Estimated time remaining: %(sec)s' + u'\03{default}' % format_values)
while(_putthread.isAlive()): try: