mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 19:37:10 +00:00
bitbake: knotty: print() was eliminated from all loops for better performance.
Refactoring prints, print() functions were eliminated from all loops and it uses "\n".join(...) in a single print() call for better performance. (Bitbake rev: c32c3d9b83818661e12f3e437563ab4e1fa05e15) Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
48e771c4a6
commit
576d8e4b40
@@ -243,9 +243,10 @@ class TerminalFilter(object):
|
|||||||
|
|
||||||
def keepAlive(self, t):
|
def keepAlive(self, t):
|
||||||
if not self.cuu:
|
if not self.cuu:
|
||||||
print("Bitbake still alive (no events for %ds). Active tasks:" % t)
|
msgbuf = ["Bitbake still alive (no events for %ds). Active tasks:" % t]
|
||||||
for t in self.helper.running_tasks:
|
for t in self.helper.running_tasks:
|
||||||
print(t)
|
msgbuf.append(str(t))
|
||||||
|
print("\n".join(msgbuf))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def updateFooter(self):
|
def updateFooter(self):
|
||||||
@@ -379,13 +380,12 @@ class TerminalFilter(object):
|
|||||||
self.termios.tcsetattr(fd, self.termios.TCSADRAIN, self.stdinbackup)
|
self.termios.tcsetattr(fd, self.termios.TCSADRAIN, self.stdinbackup)
|
||||||
|
|
||||||
def print_event_log(event, includelogs, loglines, termfilter):
|
def print_event_log(event, includelogs, loglines, termfilter):
|
||||||
# FIXME refactor this out further
|
|
||||||
logfile = event.logfile
|
logfile = event.logfile
|
||||||
if logfile and os.path.exists(logfile):
|
if logfile and os.path.exists(logfile):
|
||||||
termfilter.clearFooter()
|
termfilter.clearFooter()
|
||||||
bb.error("Logfile of failure stored in: %s" % logfile)
|
bb.error("Logfile of failure stored in: %s" % logfile)
|
||||||
if includelogs and not event.errprinted:
|
if includelogs and not event.errprinted:
|
||||||
bb.plain("Log data follows:")
|
msgbuf = ["Log data follows:"]
|
||||||
f = open(logfile, "r")
|
f = open(logfile, "r")
|
||||||
lines = []
|
lines = []
|
||||||
while True:
|
while True:
|
||||||
@@ -398,11 +398,11 @@ def print_event_log(event, includelogs, loglines, termfilter):
|
|||||||
if len(lines) > int(loglines):
|
if len(lines) > int(loglines):
|
||||||
lines.pop(0)
|
lines.pop(0)
|
||||||
else:
|
else:
|
||||||
bb.plain('| %s' % l)
|
msgbuf.append('| %s' % l)
|
||||||
f.close()
|
f.close()
|
||||||
if lines:
|
if lines:
|
||||||
for line in lines:
|
msgbuf.extend(lines)
|
||||||
bb.plain(line)
|
print("\n".join(msgbuf))
|
||||||
|
|
||||||
def _log_settings_from_server(server, observe_only):
|
def _log_settings_from_server(server, observe_only):
|
||||||
# Get values of variables which control our output
|
# Get values of variables which control our output
|
||||||
|
|||||||
Reference in New Issue
Block a user