[bitbake-devel,v3,08/15] knotty.py, knotty2, py: Flush and update footer on dynamic log level change
Submitted by Jason Wessel on June 6, 2012, 8:28 p.m.
|
Patch ID: 29343
Details
Commit Message
@@ -82,9 +82,16 @@ class TerminalFilter(object):
def clearFooter(self):
return
+ def updateFooterForce(self):
+ self.printFooter(True)
+
def updateFooter(self):
- if not main.shutdown or not self.helper.needUpdate:
- return
+ self.printFooter(False)
+
+ def printFooter(self, force_update):
+ if not force_update:
+ if not main.shutdown or not self.helper.needUpdate:
+ return
activetasks = self.helper.running_tasks
runningpids = self.helper.running_pids
@@ -238,6 +245,9 @@ def main(server, eventHandler, tf = TerminalFilter):
if stdin_mgr.poll():
keyinput = sys.stdin.read(1)
rtloglevel.setLevel(keyinput, True)
+ termfilter.updateFooterForce()
+ sys.stdout.flush()
+
# Always try printing any accumulated log files first
rtloglevel.displayLogs()
if event is None:
@@ -73,6 +73,10 @@ class TerminalFilter2(object):
sys.stdout.write(self.curses.tparm(self.ed))
self.footer_present = False
+ def updateFooterForce(self):
+ self.footer_present = False
+ self.updateFooter()
+
def updateFooter(self):
if not self.cuu:
return
This patch adds a call to update the task list after changing log modes dynamically such that you can immediately see the remaining tasks. After adding this functionality, it became obvious there was a problem flushing data loaded into stdout because the task list would not appear immediately. Doing something like "bitbake IMAGE | tee /tmp/log" is where the flush problem manifests itself the most. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> --- lib/bb/ui/knotty.py | 14 ++++++++++++-- lib/bb/ui/knotty2.py | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-)