[sdk/kde-builder] kde_builder_lib: chore: Drop unneeded accessors in StatusView

Andrew Shark <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3dbd22054f25fe8013b9cac145c41470eb2bc88a by Andrew Shark.
Committed on 24/07/2026 at 21:11.
Pushed by ashark into branch 'master'.

chore: Drop unneeded accessors in StatusView

M  +3    -3    kde_builder_lib/build_system/build_system.py
M  +13   -36   kde_builder_lib/status_view.py
M  +3    -3    kde_builder_lib/task_manager.py

https://invent.kde.org/sdk/kde-builder/-/commit/3dbd22054f25fe8013b9cac145c41470eb2bc88a

diff --git a/kde_builder_lib/build_system/build_system.py b/kde_builder_lib/build_system/build_system.py
index 2b8bfa77..31de9354 100644
--- a/kde_builder_lib/build_system/build_system.py
+++ b/kde_builder_lib/build_system/build_system.py
@@ -454,7 +454,7 @@ class BuildSystem:
         a_time = int(time.time())
 
         status_viewer = ctx.status_view
-        status_viewer.set_status(f"\t{message}")
+        status_viewer.status = Debug().colorize(f"\t{message}")
         status_viewer.update()
 
         if logger_logged_cmd.level == logging.INFO and ctx.status_view.cur_progress == -1:
@@ -479,7 +479,7 @@ class BuildSystem:
                 percentage = int(match.group(1))
 
             if percentage:
-                status_viewer.set_progress_total(100)
+                status_viewer.progress_total = 100
                 status_viewer.set_progress(percentage)
             else:
                 x, y = None, None
@@ -489,7 +489,7 @@ class BuildSystem:
 
                 if x and y:
                     # ninja-syntax
-                    status_viewer.set_progress_total(y)
+                    status_viewer.progress_total = y
                     status_viewer.set_progress(x)
 
             if "warning: " in input_line:
diff --git a/kde_builder_lib/status_view.py b/kde_builder_lib/status_view.py
index d2bc48c2..aafb2eb8 100644
--- a/kde_builder_lib/status_view.py
+++ b/kde_builder_lib/status_view.py
@@ -19,22 +19,29 @@ class StatusView:
     """
 
     def __init__(self):
-        # defaultOpts
-
         self.cur_progress = -1
         self.progress_total = -1
+        """
+        The total amount of progress deemed possible.
+        """
         self.status = ""
+        """
+        The "base" message to show as part of the update. E.g. "Compiling...".
+        """
 
         # Records number of modules built stats
         self.mod_total = -1
+        """
+        Number of modules to be built.
+        """
         self.mod_failed = 0
+        """
+        Number of modules not built successfully.
+        """
         self.mod_success = 0
-
-    def set_status(self, new_status) -> None:
         """
-        Set the "base" message to show as part of the update. E.g. "Compiling...".
+        Number of modules built successfully.
         """
-        self.status = Debug().colorize(new_status)
 
     def set_progress(self, new_progress) -> None:
         """
@@ -46,36 +53,6 @@ class StatusView:
         if old_progress != new_progress:
             self.update()
 
-    def set_progress_total(self, new_progress_total) -> None:
-        """
-        Set the total amount of progress deemed possible.
-        """
-        self.progress_total = new_progress_total
-
-    def number_modules_total(self, new_total: int = None) -> int:
-        """
-        Get (or set, if arg provided) number of modules to be built.
-        """
-        if new_total:
-            self.mod_total = new_total
-        return self.mod_total
-
-    def number_modules_succeeded(self, new_total: int | None = None) -> int:
-        """
-        Get (or set, if arg provided) number of modules built successfully.
-        """
-        if new_total:
-            self.mod_success = new_total
-        return self.mod_success
-
-    def number_modules_failed(self, new_total: int | None = None) -> int:
-        """
-        Get (or set, if arg provided) number of modules not built successfully.
-        """
-        if new_total:
-            self.mod_failed = new_total
-        return self.mod_failed
-
     def update(self) -> None:
         """
         Send out the I/O needed to ensure the latest status is displayed.
diff --git a/kde_builder_lib/task_manager.py b/kde_builder_lib/task_manager.py
index c113e0a2..c21cb46e 100644
--- a/kde_builder_lib/task_manager.py
+++ b/kde_builder_lib/task_manager.py
@@ -311,7 +311,7 @@ class TaskManager:
         num_modules = len(modules)
 
         status_viewer = ctx.status_view
-        status_viewer.number_modules_total(num_modules)
+        status_viewer.mod_total = num_modules
 
         while modules:
             module = modules.pop(0)
@@ -356,13 +356,13 @@ class TaskManager:
                     else:
                         logfile = "No log file"
                 logger_taskmanager.info("\tError log: r[" + logfile)
-                status_viewer.number_modules_failed(1 + status_viewer.number_modules_failed())
+                status_viewer.mod_failed += 1
             else:
                 # Success
                 print(f"{module.name}: Succeeded.", file=status_list_fh)
                 print(f"{module.name}", file=successfully_build_fh)
                 build_done.append(module_name)  # Make it show up as a success
-                status_viewer.number_modules_succeeded(1 + status_viewer.number_modules_succeeded())
+                status_viewer.mod_success += 1
             cur_module += 1
             logger_taskmanager.warning("")  # Space between "Building project/name (n/n)" blocks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.