diff mbox series

[2/2] knotty: some small cleanups while I'm in here

Message ID 20241206162441.894274-2-chris.laplante@agilent.com
State Accepted, archived
Commit 89613f4ba31377528d1934cc591fe33218bd916a
Headers show
Series [1/2] knotty: print an error if MACHINE is not set | expand

Commit Message

chris.laplante@agilent.com Dec. 6, 2024, 4:24 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

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

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 lib/bb/ui/knotty.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

--
2.43.0
diff mbox series

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 881df9e5fb..2fff1b3669 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -24,6 +24,12 @@  import atexit
 from itertools import groupby

 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]

@@ -103,7 +109,7 @@  def new_progress(msg, maxval):
         return NonInteractiveProgress(msg, maxval)

 def pluralise(singular, plural, qty):
-    if(qty == 1):
+    if qty == 1:
         return singular % qty
     else:
         return plural % qty
@@ -112,6 +118,7 @@  def pluralise(singular, plural, qty):
 class InteractConsoleLogFilter(logging.Filter):
     def __init__(self, tf):
         self.tf = tf
+        super().__init__()

     def filter(self, record):
         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')
         bb.utils.remove(loglink)
         try:
-           os.symlink(os.path.basename(consolelogfile), loglink)
+            os.symlink(os.path.basename(consolelogfile), loglink)
         except OSError:
-           pass
+            pass

     # Add the logging domains specified by the user on the command line
     for (domainarg, iterator) in groupby(params.debug_domains):