All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH v2] knotty: Allow displaying of status when no tasks are active
Date: Fri, 28 Sep 2012 00:06:26 +0100	[thread overview]
Message-ID: <1348787186.15753.36.camel@ted> (raw)
In-Reply-To: <1348783608.15753.31.camel@ted>

From f44c74bd864ca183590dbb2931fe3033c908ea16 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Thu, 27 Sep 2012 21:56:02 +0000
Subject: knotty: Allow displaying of status when no tasks are active

The console can appear to hang when no tasks are executing even if bitbake
is iterating through a large number of tasks behind the scenes.

This patch tweaks the footer code to display a status even when no tasks
are active to give the user better feedback about what is happening.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index d81ad5d..3799018 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -183,11 +183,11 @@ class TerminalFilter(object):
         activetasks = self.helper.running_tasks
         failedtasks = self.helper.failed_tasks
         runningpids = self.helper.running_pids
-        if self.footer_present and (self.lastpids == runningpids):
+        if self.footer_present and (self.lastcount == self.helper.tasknumber_current) and (self.lastpids == runningpids):
             return
         if self.footer_present:
             self.clearFooter()
-        if not activetasks:
+        if not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total:
             return
         tasks = []
         for t in runningpids:
@@ -195,6 +195,8 @@ class TerminalFilter(object):
 
         if self.main.shutdown:
             content = "Waiting for %s running tasks to finish:" % len(activetasks)
+        elif not len(activetasks):
+            content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
         else:
             content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
         print content
@@ -205,6 +207,7 @@ class TerminalFilter(object):
             lines = lines + 1 + int(len(content) / (self.columns + 1))
         self.footer_present = lines
         self.lastpids = runningpids[:]
+        self.lastcount = self.helper.tasknumber_current
 
     def finish(self):
         if self.stdinbackup:





      reply	other threads:[~2012-09-27 23:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 22:06 [PATCH] knotty: Allow displaying of status when no tasks are active Richard Purdie
2012-09-27 23:06 ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348787186.15753.36.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.