bitbake: knotty: some small cleanups while I'm in here

+ missing imports
+ indentation fix
+ missing call to super __init__
+ redundant parenthesis

(Bitbake rev: 89613f4ba31377528d1934cc591fe33218bd916a)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante
2024-12-06 11:24:41 -05:00
committed by Richard Purdie
parent c7b362f5ec
commit bfe176d6d5

View File

@@ -24,6 +24,12 @@ import atexit
from itertools import groupby from itertools import groupby
from bb.ui import uihelper from bb.ui import uihelper
import bb.build
import bb.command
import bb.cooker
import bb.event
import bb.runqueue
import bb.utils
featureSet = [bb.cooker.CookerFeatures.SEND_SANITYEVENTS, bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING] featureSet = [bb.cooker.CookerFeatures.SEND_SANITYEVENTS, bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING]
@@ -103,7 +109,7 @@ def new_progress(msg, maxval):
return NonInteractiveProgress(msg, maxval) return NonInteractiveProgress(msg, maxval)
def pluralise(singular, plural, qty): def pluralise(singular, plural, qty):
if(qty == 1): if qty == 1:
return singular % qty return singular % qty
else: else:
return plural % qty return plural % qty
@@ -112,6 +118,7 @@ def pluralise(singular, plural, qty):
class InteractConsoleLogFilter(logging.Filter): class InteractConsoleLogFilter(logging.Filter):
def __init__(self, tf): def __init__(self, tf):
self.tf = tf self.tf = tf
super().__init__()
def filter(self, record): def filter(self, record):
if record.levelno == bb.msg.BBLogFormatter.NOTE and (record.msg.startswith("Running") or record.msg.startswith("recipe ")): if record.levelno == bb.msg.BBLogFormatter.NOTE and (record.msg.startswith("Running") or record.msg.startswith("recipe ")):
@@ -569,9 +576,9 @@ def main(server, eventHandler, params, tf = TerminalFilter):
loglink = os.path.join(consolelogdirname, 'console-latest.log') loglink = os.path.join(consolelogdirname, 'console-latest.log')
bb.utils.remove(loglink) bb.utils.remove(loglink)
try: try:
os.symlink(os.path.basename(consolelogfile), loglink) os.symlink(os.path.basename(consolelogfile), loglink)
except OSError: except OSError:
pass pass
# Add the logging domains specified by the user on the command line # Add the logging domains specified by the user on the command line
for (domainarg, iterator) in groupby(params.debug_domains): for (domainarg, iterator) in groupby(params.debug_domains):